d***a 发帖数: 316 | 1 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.
Investigate if the following is true: a <= b <= c for all a in A; b in B;
and c in C. Give a proof or a counter-example as the case may be. | d***a 发帖数: 316 | 2 re
leaf.
【在 d***a 的大作中提到】 : 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. : Investigate if the following is true: a <= b <= c for all a in A; b in B; : and c in C. Give a proof or a counter-example as the case may be.
| l****g 发帖数: 761 | 3 http://en.wikipedia.org/wiki/File:Binary_search_tree.svg
say u end up with (7)
(4) is on left of ur path but greater than (3) | d***a 发帖数: 316 | |
|