原创 leetcode-110. Balanced Binary Tree

leetcode-110. Balanced Binary Tree 題目: Given a binary tree, determine if it is height-balanced. For this problem,

原创 leetcode-116. Populating Next Right Pointers in Each Node

leetcode-116. Populating Next Right Pointers in Each Node 題目: Given a binary tree struct TreeLinkNode { TreeLink

原创 leetcode-105. Construct Binary Tree from Preorder and Inorder Traversal

leetcode-105. Construct Binary Tree from Preorder and Inorder Traversal 題目: Given preorder and inorder traversal o

原创 leetcode-106. Construct Binary Tree from Inorder and Postorder Traversal

leetcode-106. Construct Binary Tree from Inorder and Postorder Traversal 題目: Given inorder and postorder traversal

原创 leetcode-115. Distinct Subsequences

leetcode-115. Distinct Subsequences 題目: Given a string S and a string T, count the number of distinct subsequences

原创 leetcode-109. Convert Sorted List to Binary Search Tree

leetcode-109. Convert Sorted List to Binary Search Tree 題目: Given a singly linked list where elements are sorted i

原创 leetcode-104. Maximum Depth of Binary Tree

leetcode-104. Maximum Depth of Binary Tree 題目: Given a binary tree, find its maximum depth. The maximum depth is t

原创 leetcode-107. Binary Tree Level Order Traversal II

leetcode-107. Binary Tree Level Order Traversal II 題目: Given a binary tree, return the bottom-up level order trave

原创 leetcode-121. Best Time to Buy and Sell Stock

leetcode-121. Best Time to Buy and Sell Stock 題目: Say you have an array for which the ith element is the price of

原创 leetcode-114. Flatten Binary Tree to Linked List

leetcode-114. Flatten Binary Tree to Linked List 題目: Given a binary tree, flatten it to a linked list in-place. Fo

原创 源碼分析-LinkedBlockingQueue

LinkedBlockingQueue 概述 LinkedBlockingQueue是基於鏈表的阻塞FIFO隊列,可以指定一個最大的長度限制以防止過度擴展,未指定情況下其大小爲Integer.MAX_VALUE;提供比ArrayB

原创 leetcode-113. Path Sum II

leetcode-113. Path Sum II 題目: Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equ

原创 leetcode-108. Convert Sorted Array to Binary Search Tree

leetcode-108. Convert Sorted Array to Binary Search Tree 題目: Given an array where elements are sorted in ascending

原创 leetcode-117. Populating Next Right Pointers in Each Node II

leetcode-117. Populating Next Right Pointers in Each Node II 題目: Follow up for problem “Populating Next Right Poin

原创 leetcode-119. Pascal's Triangle II

leetcode-119. Pascal’s Triangle II 題目: Given an index k, return the kth row of the Pascal’s triangle. For example,