javabinary-treebinary-search-treetree-traversalpostorder

Can a Binary Tree be recovered after performing Morris Postorder Traversal?


Morris Postorder Traversal alters the Binary Tree. Is it possible to recover the initial tree after the traversal?


Solution

  • Usually you would change the tree back after the traversal.

    Look at the detailed answer here: Can we use Morris traversal for postorder?

    It has a great code example. Just might save you some headache.