由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 问个Introduction to Algorithms上的BST题
相关主题
CLRS上的一道题面试小小经验
问个微软面试题请问为了面试准备算法,那本书比较合适
本版mj pdf合集求Introduction to Algorithms(CLRS)电子书
这个题做的对吗?请推荐 算法 和数据结构 的经典书
Amazon Interview: algorithm for 2*LOG(N) up bound for search大家有没有把introduction to algorithms这本书看完阿
报google offer,和一些总结回报本版请问有人有introduction to algorithms的电子版么
recovery BST 不考虑相同值的情况么?只会C,怎么办?
Listen to My Story(1): 算法书籍篇面G最后还是得踏踏实实看CLRS吧?
相关话题的讨论汇总
话题: search话题: path话题: keys话题: professor话题: belonging
进入JobHunting版参与讨论
1 (共1页)
D*****7
发帖数: 766
1
Professor Bunyan thinks he has discovered a remarkable property of binary
search
trees. Suppose that the search for key k in a binary search tree ends up in
a leaf.
Consider three sets: A, the keys to the left of the search path; B, the keys
on the
search path; and C, the keys to the right of the search path. Professor
Bunyan
claims that any three keys a belonging to A, b belonging to B, and c
belonging to C must satisfy a <= b <= c. Give
a smallest possible counterexample to the professor’s claim.
教师手册上没给这题的答案,似乎是嫌它太简单。可我怎么也想不出来:(
l******l
发帖数: 66
2
5
/
3
/ \
2 4
say the path is 5-3-2. 4 is to the right, but 4<5.
S****z
发帖数: 666
3
15
/
5
\
12
/ \
10 13
path 15-5-12-13
10 is to the left of the path, but 10 is > 5

in
keys

【在 D*****7 的大作中提到】
: Professor Bunyan thinks he has discovered a remarkable property of binary
: search
: trees. Suppose that the search for key k in a binary search tree ends up in
: a leaf.
: Consider three sets: A, the keys to the left of the search path; B, the keys
: on the
: search path; and C, the keys to the right of the search path. Professor
: Bunyan
: claims that any three keys a belonging to A, b belonging to B, and c
: belonging to C must satisfy a <= b <= c. Give

D*****7
发帖数: 766
4
多谢各位。
1 (共1页)
进入JobHunting版参与讨论
相关主题
面G最后还是得踏踏实实看CLRS吧?Amazon Interview: algorithm for 2*LOG(N) up bound for search
哪里能找到Introduction to algorithms (MIT, 3rd edition)比较完整的答案?报google offer,和一些总结回报本版
请教CS选课问题recovery BST 不考虑相同值的情况么?
about DFSListen to My Story(1): 算法书籍篇
CLRS上的一道题面试小小经验
问个微软面试题请问为了面试准备算法,那本书比较合适
本版mj pdf合集求Introduction to Algorithms(CLRS)电子书
这个题做的对吗?请推荐 算法 和数据结构 的经典书
相关话题的讨论汇总
话题: search话题: path话题: keys话题: professor话题: belonging