Interview Question

Software Development Engineer Interview

I was asked to create a function to check if a binary tree

  is sorted.
Answer

Interview Answer

1 Answer

1

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.

Interview Candidate on May 4, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.