Inorder Successor in BST
Medium
Binary Search Tree
Given a BST (level-order form) and the value p of a node in it, print the value of the inorder successor (the smallest value greater than p), or null if there is none.
Constraints
1 <= number of nodes <= 10^4 All values are unique
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.