adding animation

This commit is contained in:
Jidong Xiao
2025-03-24 18:01:08 -04:00
committed by JamesFlare
parent c57da3131c
commit 6198e34b84

View File

@@ -41,6 +41,7 @@ only one valid memory layout for this data as a ds_set? Why?
## 20.2 Second Approach of Operator++ ## 20.2 Second Approach of Operator++
We can also implement operator++ for the ds_set iterator without using the parent pointers. To achieve this, we need a container of pointers representing path from root to node. The following diagram represents the idea, and the code is provided here: [ds_set_ptrs.h](ds_set_ptrs.h) and [ds_set_main.cpp](ds_set_main.cpp). We can also implement operator++ for the ds_set iterator without using the parent pointers. To achieve this, we need a container of pointers representing path from root to node. The following diagram represents the idea, and the code is provided here: [ds_set_ptrs.h](ds_set_ptrs.h) and [ds_set_main.cpp](ds_set_main.cpp).
![alt text](ds_set_history.png "ds set history") ![alt text](ds_set_history.png "ds set history")
## 20.3 Depth-first vs. Breadth-first Search ## 20.3 Depth-first vs. Breadth-first Search
@@ -188,6 +189,8 @@ Draw picture of each case!
- Then we recursively apply erase to remove that node — which is guaranteed to have at most one child. - Then we recursively apply erase to remove that node — which is guaranteed to have at most one child.
play this [animation](https://jidongxiao.github.io/CSCI1200-DataStructures/animations/trees/delete_node/index.html) to understand how this works.
Exercise: Write a recursive version of erase. Exercise: Write a recursive version of erase.