Y
Hacker News
new
|
ask
|
show
|
jobs
by
kristov
1295 days ago
Is there a practical reason to do this in a real-world program?
1 comments
saagarjha
1295 days ago
Sure, it’s the binary tree equivalent of reversing an array.
link
Tainnor
1295 days 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.
link