Search
⌘K

Leetcode 285. Inorder Successor in BST

Given the root of a binary search tree and a target node p, return p's in-order successor — the node with the smallest key greater than p's key. Leverage BST ordering (e.g., examine p's right subtree or traverse from the root tracking potential successors) to achieve O(h) time.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.