TreesExplained
Top View
The first node seen at each horizontal distance from above.
Time
O(n)
Extra space
O(n)
Use it for
What you see looking down on the tree.
The first node seen at each horizontal distance from above.
Time
O(n)
Extra space
O(n)
Use it for
What you see looking down on the tree.