โ† LinkedIn questions

Total number of visible nodes in a binary tree

Filed under LinkedIn

The question

Find the total number of visible nodes in a binary tree in O(n) time, where a node is visible if it has the highest value in the path from the root to that node.

No write-up yet. Related questions below have one.

Related LinkedIn questions

Collected from public candidate posts and coding forums. Updated Nov 2026.