Create Tree Top View
Open
algorithms
C
CPP
good first issue
hacktoberfest
Hacktoberfest2020
tree
- Dominant language
- C++
- Stars
- 504
- Forks
- 436
- PR merge metrics
- No merged PRs in 30d
Description
Given a binary tree , print the nodes in left to right manner as visible from above the tree
Input Format
Level order input for the binary tree will be given.
Constraints
No of nodes in the tree can be less than or equal to 10^7
Output Format
A single line containing space separated integers representing the top view of the tree
Sample Input
1 2 3 4 5 6 -1 -1 -1 -1 -1 -1 -1
Sample Output
4 2 1 3
Explanation
The tree looks like
1
/ \
2 3
/ \ /
4 5 6
When viewed from the top , we would see the nodes 4, 2, 1 and 3.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.