Dsa
Binary Search Tree
Easy
Find First Greater
Given a binary search tree (BST) and an integer target, write a function that finds and returns the first node whose value is greater than the target. If no such node exists, return null. The input is a level-order traversal format.
Example Input:
5
3 8 1 4 6 10
null null null null null null null null
3
Output:
4
Key concepts
binary_search_treesearching
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now