adding erase animation'

This commit is contained in:
Jidong Xiao
2023-09-28 23:34:16 -04:00
parent 6c390995f0
commit f9d59b26fa

View File

@@ -42,9 +42,8 @@ erase_from_vector, pop_back, and push_back.
When items are continually being inserted and removed, vectors are not a good choice for the container. When items are continually being inserted and removed, vectors are not a good choice for the container.
- Instead we need a different sequential container, called a list. - Instead we need a different sequential container, called a list.
- This has a “linked” structure that makes the cost of erasing independent of the size. - This has a “linked” structure that makes the cost of erasing independent of the size.
- We will move toward a list-based implementation of the program in two steps:
- Rewriting our classlist vec.cpp code in terms of iterator operations. - Play this [animation](https://jidongxiao.github.io/CSCI1200-DataStructures/animations/lists/erase/index.html) to see why list is better than vector in terms of the erase operation.
- Replacing vectors with lists
## 9.4 Iterators ## 9.4 Iterators