Category: recursive
Return the root node of a binary search tree that matches the given preorder traversal. (Recall that a binary search tree is a binary tree where for every node, …
Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path …
Given a binary search tree, return a balanced binary search tree with the same node values. A binary search tree is balanced if and only if the depth of …
Given a binary tree with the following rules: root.val == 0 If treeNode.val == x and treeNode.left != null, then treeNode.left.val == 2 * x + 1 If treeNode.val …
A tree rooted at node 0 is given as follows: The number of nodes is nodes; The value of the i-th node is value; The parent of the i-th …