From 1066231f1ad0b1b4d689f7857d1013b61c519056 Mon Sep 17 00:00:00 2001 From: John Washam Date: Thu, 9 Jun 2016 09:16:15 -0700 Subject: [PATCH] Moved Big O notation. --- plan.txt | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/plan.txt b/plan.txt index 911b498..cbbce4b 100644 --- a/plan.txt +++ b/plan.txt @@ -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 - No need to spend a whole day on this. * - 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: * - 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) @@ -126,13 +132,15 @@ arrays * - capacity() - number of items it can hold * - is_empty() - 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) - prepend(item) - can use insert above at index 0 - delete(index) - remove(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 - O(1) to add/remove at end (amortized for allocations for more space), index, or update - O(n) to insert/remove elsewhere @@ -260,9 +268,6 @@ Other data structures: - Know what NP-complete means. Recursion - when it is appropriate to use it -Algorithmic complexity - - http://discrete.gr/complexity/ - - http://bigocheatsheet.com/ open-ended problems - manipulate strings - manipulate patterns