Tree Algorithms
Everything on SkillVeris tagged Tree Algorithms — collected across the glossary, study notes, blog, and cheat sheets.
6 resources across 1 library
Interview Questions(6)
What is the Lowest Common Ancestor (LCA) Problem?
The lowest common ancestor problem asks for the deepest node in a tree that has both of two given nodes as descendants, and it is typically solved in O(n) with…
What is Morris Traversal?
Morris traversal is a technique for performing in-order (or pre-order) traversal of a binary tree in O(1) extra space by temporarily converting the tree into a…
What is a Threaded Binary Tree?
A threaded binary tree is a binary tree variant where null left or right child pointers are repurposed as 'threads' pointing directly to the node's in-order pr…
What is Tree Dynamic Programming?
Tree dynamic programming solves a problem on a tree by computing a DP value at each node from the already-solved DP values of its children, using a post-order…
What is Heavy-Light Decomposition?
Heavy-light decomposition splits a tree into vertical chains so that any root-to-node path crosses at most O(log n) chains, letting path queries (sum, max, upd…
What are Persistent Data Structures?
A persistent data structure preserves every previous version of itself after an update, so old versions remain fully accessible and queryable, typically implem…