# Tag: Tree

Binary Tree Maximum Path Sum. For a particular binary tree path with maximum sum, it must be has one node with smallest depth, a tree path (path from top to…

Populating Next Right Pointers in Each Node II. Same as Populating Next Right Pointers in Each Node. But you need to be more flexible because all the next pointers of a…

Populating Next Right Pointers in Each Node. Low level list node operation. You need to link the left child to the right child of a root first, then link the…

Minimum Depth of Binary Tree. Just recursively calculate the min depth of left and right subtree, pick the smaller one and add one to the depth.

Convert Sorted List to Binary Search Tree. Same solution as Convert Sorted Array to Binary Search Tree. But you need to use a trick to get the middle point in the…

Convert Sorted Array to Binary Search Tree. Just take a middle node as the root and construct left and right tree recursively.

Binary Tree Level Order Traversal II. Same solution as Binary Tree Level Order Traversal. I use a stack to reverse the level order.