dsa1 min read
Construct Binary Tree from Preorder and Inorder — HashMap Index
Build a binary tree from preorder and inorder traversals by using the preorder root and inorder index to split left/right subtrees.
Read →
webcoderspeed.com
1276 articles
Build a binary tree from preorder and inorder traversals by using the preorder root and inorder index to split left/right subtrees.
Count paths in a binary tree summing to target (not necessarily root-to-leaf) using a prefix sum frequency map.
Find and delete a node from a BST while maintaining BST properties using in-order successor.
Flatten a binary tree to a linked list in-place using pre-order traversal order.
Connect each node to its next right node using BFS level order or O(1) space pointer manipulation.