BST 6 Efficiency of BST Operations Flashcards
1
Q
If the BST contains n nodes, how many nodes will we visit AT WORST?
A
![](https://s3.amazonaws.com/brainscape-prod/system/cm/227/001/017/a_image_thumb.png?1512661475)
2
Q
In a BSt, how many of the items do we eliminate at each step?
A
![](https://s3.amazonaws.com/brainscape-prod/system/cm/227/001/110/a_image_thumb.png?1512661536)
3
Q
What does a worst case tree look like and what data structure does it resemble
A
![](https://s3.amazonaws.com/brainscape-prod/system/cm/227/001/260/a_image_thumb.png?1512661598)
4
Q
Define what the level of a node is
A
![](https://s3.amazonaws.com/brainscape-prod/system/cm/227/001/332/a_image_thumb.png?1512661625)
5
Q
What does a good tree look like and what properties does it have?
A
![](https://s3.amazonaws.com/brainscape-prod/system/cm/227/001/351/a_image_thumb.png?1512661678)
6
Q
What is a full/complete tree? What properties does it have? What is the formula?
A
![](https://s3.amazonaws.com/brainscape-prod/system/cm/227/001/409/a_image_thumb.png?1512661739)
7
Q
What is the shortest a tree could be, if it has n nodes? What is the height?
A
![](https://s3.amazonaws.com/brainscape-prod/system/cm/227/001/470/a_image_thumb.png?1512661789)
8
Q
What is the height of a worst case tree (linked-list)
A
![](https://s3.amazonaws.com/brainscape-prod/system/cm/227/001/574/a_image_thumb.png?1512661841)
9
Q
What is the operation efficiency of a best case and worst case tree? How long would each take with 1,000,000 keys?
A
- Full/Complete tree = O(log n)
- With 1,000,000 keys would take around 20 steps
- Wrost/Snake tree = O(n)
- With 1,000,000 keys would take 1,000,000