Identify swapped subtrees in a binary search trees

后端 未结 0 1108
一个人的身影
一个人的身影 2021-01-24 04:09

Suppose two subtrees in a Binary search trees has been swapped, and that the BST property is broken. Devise an algorithm that identifies the two swapped subtrees in O(n) time.

相关标签:
回答
  • 消灭零回复
提交回复
热议问题