Tuesday, June 9, 2015

Morris inorder traversal - binary tree

May 26, 2015
Problem Statement: 
Print inorder traversal of the tree without using extra space (Morris Traversal)
Study two websites:
Implement the code using C#, and use the same example in the above website.
Here is the short description to understand the algorithm:
Concept Involved: 
Morris traversal is an implementation of in-order traversal that uses threading:
1.    Create links to the in-order successor
2.    Print the data using these links
3.    Revert the changes to restore original tree.
Here is the C# code:

read the blog (July 9, 2015):


No comments:

Post a Comment