How to determine the level of each node in the given tree?
node level [node]
s (source node) 0
1 1
2 1
3 2
4 2
5 2
6 2
7 3