Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 10
- / \
- 8 20
- \ \
- 4 40
- / \ /
- 3 6 35
- /
- 5
- 6 -> came from 5, coming from left, but 6 hasn't got right so go up
- 4 -> came from 6, coming from right, so go up
- 8 -> came from 4, coming from right, so go up
- 10 -> nor coming right, and 10 has got right, so make a right turn
- 20 -> not a leaf, hasn't got left go right
- 40 -> not a leaf, has got left go left
- 35 -> leaf so this is next leaf.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement