dsa2 min read
Closest Binary Search Tree Value II
Find k values closest to target in a BST using two in-order iterators (forward and reverse) with a two-pointer merge.
Read →
1575 articles
Find k values closest to target in a BST using two in-order iterators (forward and reverse) with a two-pointer merge.
Transform a binary tree so every right child becomes a sibling and left child becomes parent using iterative rotation.
Find the inorder successor of a node in a BST when you have access to parent pointers.
Find second minimum value in a special binary tree where root is min and each node equals min of its children.
Build a preorder string representation of a binary tree using parentheses to show tree structure.