Microsoft Interview Question

I was asked to create a function to check if a binary tree is sorted.

Interview Answer

Anonymous

May 4, 2013

Created an in-order tree traversal that retains the last node visited. If the last node is greater than the current node, the tree is not sorted.

1