TreeΒΆ
How To: Tree
Binary tree inorder traversal
Recover binary search tree
Binary tree preorder traversal [Morris Traversal, Stack]
Binary tree postorder traversal [Morris Traversal, Stack]
Implement tree (prefix tree)
Add and search word data structure design
Invert binary tree [BFS, Stack, DFS]
Serialize and deserialize binary tree
Range sum query mutable [BIT, Segment Tree]
Range sum query 2D mutable [BIT]
Count of smaller numbers after self [D&C, BIT, BST]
Most frequent subtree sum
Convert BST to greater tree
Diameter of binary tree [DFS]
Binary tree tilt [Recursion]
Subtree of another tree
Construct string from binary tree [Recursion, Stack]
Merge two binary trees [Recursion]
Average of levels in binary tree
Find duplicate subtrees
Two sum IV [BST]
Maximum binary tree
Print binary tree
Maximum width of binary tree
Equal tree partition
Implement a MapSum class
Redundant connection
Redundant connection II
Longest univalue path [Recursion]
Falling squares [Offline Prop,Segment Tree, Block Decomp,Brute Force]
Binary Tree Pruning [DFS]
Rectangle Area II [Segment Tree]
All nodes distance k in binary tree [DFS + BFS]
Smallest subtree with all the deepest nodes [DFS]
Construct binary tree from preorder and postorder traversal [DFS, stack]
Increasing order search tree [DFS]
Complete binary tree inserter
Range sum of BST [DFS]
Flip equivalent binary trees [DFS]
Check completeness of a binary tree [BFS]
Univalued binary tree [DFS]
Flip binary tree to match preorder traversal [DFS]
Distribute coins in binary tree [DFS]
Vertical order traversal of a binary tree [DFS]
Smallest string starting from leaf [DFS]
Cousins in binary tree [DFS]
Maximum binary tree II
Construct binary search tree from preorder traversal
Sum of root to leaf binary numbers
Maximum difference between node and ancestor [DFS]
Recover a tree from preorder traversal [DFS]
Stream of characters [Aho-Corasick Automata, Trie]
Binary search tree to greater sum tree [DFS]
Index pairs of a string [Aho-Corasick Automata, Trie]
Insufficient nodes in root to leaf paths [DFS]
Path in zigzag labelled binary tree [Math]
Maximum average subtree [DFS]
Lowest common ancestor of deepest leaves [DFS]
Binary tree coloring game [DFS]
Smallest common region
Find elements in a contaminated binary tree [DFS]
Delete leaves with a given value [DFS]
Maximum product of splitted binary tree [DFS]
Queries on a permutation with key [BIT, Fenwick Tree]
Check if a string is a valid sequence from root to leaves path in a binary tree [BFS, DFS, Stack]