LeetCode 652: Find Duplicate Subtrees
A clear explanation of finding duplicate binary tree subtrees using postorder traversal, serialization, and a hash map.
3 notes
A clear explanation of finding duplicate binary tree subtrees using postorder traversal, serialization, and a hash map.
Serialize a binary search tree compactly with preorder traversal and rebuild it using BST value bounds.
Serialize an N-ary tree into a string and reconstruct the same tree using preorder traversal with child counts.