[关闭]
@w1024020103 2017-04-10T15:34:57.000000Z 字数 631 阅读 562

Lecture 21: Binary Search Trees

CS61B


提示:可以做一做他们的midterm exam,目前有两个了

BST Property

40.JPG-69.3kB

No duplicate keys allowed:

41.JPG-77.4kB

BST Operations:

Finding a searchKey in a BST

42.JPG-64.2kB

Worst case runtime to complete a search on a "bushy" BST:

43.JPG-47.2kB

Inserting a new key into a BST

44.JPG-79.5kB

Deleting from a BST

三种情况
7.JPG-47.1kB

1.JPG-53.6kB

8.JPG-64.4kB

9.JPG-84.8kB

例子:
10.JPG-41.5kB

11.JPG-47.9kB

12.JPG-52.8kB

BST Performance

13.JPG-61.1kB

数学分析:
14.JPG-88.4kB

deletion需要C(N)~sqrt(N) per operation:
15.JPG-60.7kB

summary:
Binary search tree的insertion和search都很高效:

问题:

C level
1.What is the best case BST height in terms of N? Worst case?

17.JPG-47.3kB

13.JPG-61.1kB

3.微信图片_20170410104048.png-25.3kB

4.19.jpg-23.5kB
相关slide:
9.JPG-84.8kB

B LEVEL
20.jpg-70.6kB

solution:
21.JPG-29.1kB

这道题不是很懂:
22.jpg-81.3kB

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注