Skip to the content.

Asked by Palantir. (One of the most asked Questions)

Question

Typically, an implementation of in-order traversal of a binary tree has O(h) space complexity, where h is the height of the tree. Write a program to compute the in-order traversal of a binary tree using O(1) space.