If an inorder traversal on a binary tree gets the elements in sorted order, does it necessarily prove it is a binary search tree?
s*y
2 楼
Anyone know grants for post docs over 5 years, without green card?
g*s
3 楼
a bt is bst iff inorder travesal returns a strictly sorted array. notice there's trap: if the bt has duplicate elements, it can't be a bst. but if excluding duplicates, u can use mathematical induction to prove it.
order,
【在 m*****e 的大作中提到】 : If an inorder traversal on a binary tree gets the elements in sorted order, : does it necessarily prove it is a binary search tree?
m*e
4 楼
That's also what I think. Thanks for confirming it.