|
@@ -114,11 +114,17 @@ Then test it out on a computer to make sure it's not buggy from syntax.
|
|
|
|
|
|
----------------------------------------------------------------
|
|
----------------------------------------------------------------
|
|
|
|
|
|
|
|
+Algorithmic complexity
|
|
|
|
+ - nothing to implement
|
|
|
|
+ - math explanation: https://www.youtube.com/watch?v=ei-A_wy5Yxw&index=2&list=PL1BaGV1cIH4UhkL8a9bJGG356covJ76qN
|
|
|
|
+ - https://www.youtube.com/watch?v=V6mKVRU1evU
|
|
|
|
+ - http://discrete.gr/complexity/
|
|
|
|
+ - http://bigocheatsheet.com/
|
|
arrays
|
|
arrays
|
|
- No need to spend a whole day on this.
|
|
|
|
* - Description:
|
|
* - Description:
|
|
- - https://www.coursera.org/learn/data-structures/lecture/OsBSF/arrays
|
|
|
|
- - https://www.coursera.org/learn/data-structures/lecture/EwbnV/dynamic-arrays
|
|
|
|
|
|
+ - Arrays: https://www.coursera.org/learn/data-structures/lecture/OsBSF/arrays
|
|
|
|
+ - Dynamic Arrays: https://www.coursera.org/learn/data-structures/lecture/EwbnV/dynamic-arrays
|
|
|
|
+ - Resizing arrays: https://class.coursera.org/algs4partI-010/lecture/19
|
|
- Implement:
|
|
- Implement:
|
|
* - Practice coding using arrays and pointers, and pointer math to jump to an index instead of using indexing.
|
|
* - Practice coding using arrays and pointers, and pointer math to jump to an index instead of using indexing.
|
|
* - new raw data array with allocated memory (can allocate int array under the hood, just not use its features)
|
|
* - new raw data array with allocated memory (can allocate int array under the hood, just not use its features)
|
|
@@ -126,13 +132,15 @@ arrays
|
|
* - capacity() - number of items it can hold
|
|
* - capacity() - number of items it can hold
|
|
* - is_empty()
|
|
* - is_empty()
|
|
- at(index) - returns item at given index
|
|
- at(index) - returns item at given index
|
|
- - cannot append or move if full - will not tackle allocating and copying to new memory
|
|
|
|
- - append(item)
|
|
|
|
|
|
+ - append(item) - or push(item)
|
|
- insert(index, item)
|
|
- insert(index, item)
|
|
- prepend(item) - can use insert above at index 0
|
|
- prepend(item) - can use insert above at index 0
|
|
- delete(index)
|
|
- delete(index)
|
|
- remove(item)
|
|
- remove(item)
|
|
- find(item)
|
|
- find(item)
|
|
|
|
+ - resize(new_capacity) // private function
|
|
|
|
+ - when you reach capacity, resize to double the size
|
|
|
|
+ - when popping an item, if size is 1/4 of capacity, resize to half
|
|
- Time
|
|
- Time
|
|
- O(1) to add/remove at end (amortized for allocations for more space), index, or update
|
|
- O(1) to add/remove at end (amortized for allocations for more space), index, or update
|
|
- O(n) to insert/remove elsewhere
|
|
- O(n) to insert/remove elsewhere
|
|
@@ -260,9 +268,6 @@ Other data structures:
|
|
- Know what NP-complete means.
|
|
- Know what NP-complete means.
|
|
Recursion
|
|
Recursion
|
|
- when it is appropriate to use it
|
|
- when it is appropriate to use it
|
|
-Algorithmic complexity
|
|
|
|
- - http://discrete.gr/complexity/
|
|
|
|
- - http://bigocheatsheet.com/
|
|
|
|
open-ended problems
|
|
open-ended problems
|
|
- manipulate strings
|
|
- manipulate strings
|
|
- manipulate patterns
|
|
- manipulate patterns
|