Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdded Iterative Preorder Traversal in the traversal Functions. #3497
Conversation
I have used Stack for the iterative Preorder Traversal.
Travis tests have failedHey @imsaurabh8, TravisBuddy Request Identifier: ad4ad4f0-113a-11eb-bfd1-1f84b849c73d |
I have used Stack for the iterative Preorder Traversal.
Describe your change:
Steps To Follow-
a) Pop an item from stack and print it.
b) Push right child of popped item to stack
c) Push left child of popped item to stack
Right child is pushed before left child to make sure that left subtree is processed first.
Checklist:
Fixes: #{$ISSUE_NO}.