Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
kristov
· 4y ago · 0 comments
Is there a practical reason to do this in a real-world program?
Comments
[–]
saagarjha
4y ago
Sure, it’s the binary tree equivalent of reversing an array.
[–]
Tainnor
4y ago
For large enough trees it's probably more efficient to instead just switch from preorder to postorder traversal instead of changing the whole tree.