由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - inorder traversal and BST
相关主题
F家phone interview的一道题攒人品,amazon一面经历
recover binary search tree 常数空间攒人品,Amazon 二面面经
Find the node with given value in binary tree in in-order[合集] 微软面试的一道题
Leetcode Recover Binary Search Tree一问Construct Binary Tree from Inorder and Postorder Traversal
Create Binary Tree from preorder and inorder arrays为何找不到很多apple的面筋
问几个有关Binary tree的题LeetCode题Binary Tree Inorder Traversal
大概说一下昨天的Google Phone Interviewleetcode里面的Recover Binary Search Tree怎么用O(1)space
树 inorder下个节点最好办法是啥面了个三哥今天
相关话题的讨论汇总
话题: bst话题: inorder话题: traversal话题: binary话题: tree
进入JobHunting版参与讨论
1 (共1页)
m*****e
发帖数: 47
1
If an inorder traversal on a binary tree gets the elements in sorted order,
does it necessarily prove it is a binary search tree?
g*********s
发帖数: 1782
2
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
发帖数: 47
3
That's also what I think. Thanks for confirming it.
1 (共1页)
进入JobHunting版参与讨论
相关主题
面了个三哥今天Create Binary Tree from preorder and inorder arrays
如何判断两个BST的元素是一样的?问几个有关Binary tree的题
find kth smallest key in BST with O(lgn)大概说一下昨天的Google Phone Interview
一个电面疑问树 inorder下个节点最好办法是啥
F家phone interview的一道题攒人品,amazon一面经历
recover binary search tree 常数空间攒人品,Amazon 二面面经
Find the node with given value in binary tree in in-order[合集] 微软面试的一道题
Leetcode Recover Binary Search Tree一问Construct Binary Tree from Inorder and Postorder Traversal
相关话题的讨论汇总
话题: bst话题: inorder话题: traversal话题: binary话题: tree