由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - detect number of duplicates in bst
相关主题
binary tree, sum of 2 nodes == given number算法题:min heap inplace变 BST
面经请教一个问题
请教find number of duplicates in a binary search tree【什么时候需要做heap, 什么时候需要做BST】
一道面试题问个微软面试题
请教一题请问两道题
关于BST traverse的复杂度问个题
弱问,BST到底能不能有重复值?t店面经
来道难一点的题Yahoo! onsite 面经
相关话题的讨论汇总
话题: bst话题: duplicates话题: detect话题: number话题: 12
进入JobHunting版参与讨论
1 (共1页)
p***s
发帖数: 78
1
这道题怎么做 ?
duplicates in array is nlogn (不用hash), 这个怎么更快?
d****o
发帖数: 1055
2
中序遍历bst,然后duplicate的肯定是挨着出现得。

【在 p***s 的大作中提到】
: 这道题怎么做 ?
: duplicates in array is nlogn (不用hash), 这个怎么更快?

p***s
发帖数: 78
3
这个算不算BST?
10
/ \
8 12
/ \
7 9
\
8

【在 d****o 的大作中提到】
: 中序遍历bst,然后duplicate的肯定是挨着出现得。
l****c
发帖数: 782
4
不算吧,最下面的8,BST不能擦到那里吧。

【在 p***s 的大作中提到】
: 这个算不算BST?
: 10
: / \
: 8 12
: / \
: 7 9
: \
: 8

p***s
发帖数: 78
5
根据这个定义,下面这个是吧,否则最后一个8怎么放
http://en.wikipedia.org/wiki/Binary_search_tree#Insertion
10
/ \
8 12
/ \
7 9
/
8

【在 l****c 的大作中提到】
: 不算吧,最下面的8,BST不能擦到那里吧。
M******k
发帖数: 51
6
it is BST; and 8 and 8 are still adjacent in in-order traversal

【在 p***s 的大作中提到】
: 这个算不算BST?
: 10
: / \
: 8 12
: / \
: 7 9
: \
: 8

1 (共1页)
进入JobHunting版参与讨论
相关主题
Yahoo! onsite 面经请教一题
M onsite关于BST traverse的复杂度
问一道题~弱问,BST到底能不能有重复值?
A家店面第一次 攒人品来道难一点的题
binary tree, sum of 2 nodes == given number算法题:min heap inplace变 BST
面经请教一个问题
请教find number of duplicates in a binary search tree【什么时候需要做heap, 什么时候需要做BST】
一道面试题问个微软面试题
相关话题的讨论汇总
话题: bst话题: duplicates话题: detect话题: number话题: 12