Question 6

Write a function that does an in-order traversal of a tree and prints out the contents (Assume each node has 1 piece of content which is an integer).
Write this function without using recursion (you can assume a library that has stack/queue/list objects with some standard methods is available for use by you).
What is the maximum size your stack can grow to and what is the expected size that your data structure can grow to assuming that the tree has n nodes?

[advanced_iframe securitykey=”undefined” src=”” width=”100%” height=”600″]

Register for the new batch at KodNest and start your journey to success.Secure Your Spot Now!Claim Your Seat

Request A Callback

Get a Free 30-minute Counseling session with our experts.