This commit is contained in:
tiendung 2023-05-23 23:15:49 +07:00
parent 40521d3beb
commit 3a11b93f88
1 changed files with 9 additions and 9 deletions

View File

@ -580,23 +580,23 @@ if you can identify the runtime complexity of different algorithms. It's a super
## Data Structures
- ### Arrays
- [x ] About Arrays:
- [x] About Arrays:
- [Arrays CS50 Harvard University](https://www.youtube.com/watch?v=tI_tIZFyKBw&t=3009s)
- [Arrays (video)](https://www.coursera.org/lecture/data-structures/arrays-OsBSF)
- [UC Berkeley CS61B - Linear and Multi-Dim Arrays (video)](https://archive.org/details/ucberkeley_webcast_Wp8oiO_CZZE) (Start watching from 15m 32s)
- [Dynamic Arrays (video)](https://www.coursera.org/lecture/data-structures/dynamic-arrays-EwbnV)
- [Jagged Arrays (video)](https://www.youtube.com/watch?v=1jtrQqYpt7g)
- [ ] Implement a vector (mutable array with automatic resizing):
- [x ] Practice coding using arrays and pointers, and pointer math to jump to an index instead of using indexing.
- [x ] New raw data array with allocated memory
- [x] Practice coding using arrays and pointers, and pointer math to jump to an index instead of using indexing.
- [x] New raw data array with allocated memory
- can allocate int array under the hood, just not use its features
- start with 16, or if starting number is greater, use power of 2 - 16, 32, 64, 128
- [ x] size() - number of items
- [x ] capacity() - number of items it can hold
- [x ] is_empty()
- [x ] at(index) - returns item at given index, blows up if index out of bounds
- [x ] push(item)
- [x ] insert(index, item) - inserts item at index, shifts that index's value and trailing elements to the right
- [x] size() - number of items
- [x] capacity() - number of items it can hold
- [x] is_empty()
- [x] at(index) - returns item at given index, blows up if index out of bounds
- [x] push(item)
- [x] insert(index, item) - inserts item at index, shifts that index's value and trailing elements to the right
- [ ] prepend(item) - can use insert above at index 0
- [ ] pop() - remove from end, return value
- [ ] delete(index) - delete item at index, shifting all trailing elements left