Microsoft interview question

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

Interview Answer

Anonymous

4 May 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