moving image to lecture 20

This commit is contained in:
Jidong Xiao
2025-03-24 17:58:33 -04:00
committed by JamesFlare
parent d6e4a2cfae
commit d833d16444
2 changed files with 6 additions and 5 deletions

View File

@@ -86,7 +86,7 @@ point to the “in-order predecessor”.
Each node stores a parent pointer. Only the root node has a null parent pointer. [method 1]
Each iterator maintains a stack of pointers representing the path down the tree to the current node. [method 2]
Each iterator maintains a container of pointers representing the path down the tree to the current node. [method 2]
- If we choose the parent pointer method, well need to rewrite the insert and erase member functions to
@@ -99,11 +99,12 @@ Be sure to draw a picture to help you understand!
![alt text](ds_set_parent_ptrs.png "ds set parent ptrs")
Exercise: [method 2] Write a fragment of code that given a tree iterator containing a pointer to the node and a
stack of pointers representing path from root to node, finds the in-order successor (without using parent pointers).
Either version can be extended to complete the implementation of increment/decrement for the ds_set tree iterators.
![alt text](ds_set_history.png "ds set history")
container of pointers representing path from root to node, finds the in-order successor (without using parent pointers).
Either version can be extended to complete the implementation of increment/decrement for the ds_set tree iterators. (This method will be covered in the next lecture)
Exercise: What are the advantages & disadvantages of each method?
<!-- ![alt text](ds_set_history.png "ds set history") -->
<!-- Exercise: What are the advantages & disadvantages of each method? -->
## 19.5 Limitations of Our BST Implementation

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB