摘要:
The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two leaves in the tree. The diagram below shows 阅读全文
摘要:
Given a binary tree with each node having one extra field of nextRight. nextRight points to the next right node of the same level. Initially all nodes 阅读全文
摘要:
Given a Binary Tree, find if there exist edge whose removal creates two trees of equal size. Examples: To find whether such an edge exists, we need to 阅读全文
摘要:
Given a sorted array of n integers, find the starting and ending position of a given target value. If the target is not found in the array, return [-1 阅读全文
摘要:
Given a binary search tree (See Definition) and a node in it, find the in-order successor of that node in the BST. If the given node has no in-order s 阅读全文
摘要:
Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it up 阅读全文
摘要:
Given a binary tree, collect a tree's nodes as if you were doing this: Collect and remove all leaves, repeat until the tree is empty. Have you met thi 阅读全文
摘要:
Given a binary tree, return the vertical order traversal of its nodes' values. (ie, from top to bottom, column by column). If two nodes are in the sam 阅读全文
摘要:
Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all 阅读全文
摘要:
Given a binary tree, check whether it is a mirror of itself using both recursion and iterative approach. Examples: Solution 1. Recursion For two trees 阅读全文