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=”https://code.kodnest.com/” width=”100%” height=”600″]

KodNest Training New Batch is starting on 19th October 2020. Attend one week free demo classes.Register Now

New Report

Close