Lowest Common Ancestor II
Given the root and two nodes in a Binary Tree. Find the lowest common ancestor(LCA) of the two nodes.
Given the root and two nodes in a Binary Tree. Find the lowest common ancestor(LCA) of the two nodes.
Check if two binary trees are identical. Identical means the two binary trees have the same structure and every identical position has the same value.
Flatten a binary tree to a fake “linked list” in pre-order traversal.
Given a binary tree, find all paths that sum of the nodes in the path equals to a given number target.
For the given binary tree, return a deep copy of it.
Given a binary tree, design an algorithm which creates a linked list of all the nodes at each depth.
Given a number, insert a 5 at any position of the number to make the number after insertion the largest
Given a binary tree, return the postorder traversal of its nodes’ values. (Iteratively)