Combined heap, priority queue, binary heap.

This commit is contained in:
John Washam 2016-07-06 21:39:21 -07:00
parent 6fd9d40f39
commit 4af27d5e49
1 changed files with 48 additions and 39 deletions

View File

@ -420,7 +420,25 @@ Then test it out on a computer to make sure it's not buggy from syntax.
- [x] delete_value - [x] delete_value
- [x] get_successor // returns next-highest value in tree after given value, -1 if none - [x] get_successor // returns next-highest value in tree after given value, -1 if none
- [x] **Balanced binary trees** - [ ] **Heap / Priority Queue / Binary Heap:**
- visualized as a tree, but is usually linear in storage (array, linked list)
- [ ] https://en.wikipedia.org/wiki/Heap_(data_structure)
- [x] https://www.coursera.org/learn/data-structures/lecture/2OpTs/introduction
- [x] https://www.coursera.org/learn/data-structures/lecture/z3l9N/naive-implementations
- [x] https://www.coursera.org/learn/data-structures/lecture/GRV2q/binary-trees
- [x] https://www.coursera.org/learn/data-structures/supplement/S5xxz/tree-height-remark
- [x] https://www.coursera.org/learn/data-structures/lecture/GRV2q/binary-trees
- [ ] https://www.coursera.org/learn/data-structures/lecture/0g1dl/basic-operations
- [ ] https://www.coursera.org/learn/data-structures/lecture/gl5Ni/complete-binary-trees
- [ ] https://www.coursera.org/learn/data-structures/lecture/HxQo9/pseudocode
- [ ] https://class.coursera.org/algs4partI-010/lecture
- [ ] https://class.coursera.org/algs4partI-010/lecture/39
- [ ] https://en.wikipedia.org/wiki/Priority_queue
- [ ] https://www.youtube.com/watch?v=ute-pmMkyuk&index=7&list=PLOtl7M3yp-DV69F32zdK7YJcNXpTunF2b
- [ ] https://www.youtube.com/watch?v=yIUFT6AKBGE&index=24&list=PL4BBB74C7D2A1049C
- [ ] https://en.wikipedia.org/wiki/Fibonacci_heap
- [ ] **Balanced binary trees**
- Know least one type of balanced binary tree (and know how it's implemented): - Know least one type of balanced binary tree (and know how it's implemented):
- [x] **AVL trees** - [x] **AVL trees**
@ -430,21 +448,21 @@ Then test it out on a computer to make sure it's not buggy from syntax.
- [x] https://www.coursera.org/learn/data-structures/lecture/22BgE/split-and-merge - [x] https://www.coursera.org/learn/data-structures/lecture/22BgE/split-and-merge
- [ ] **splay trees** - [ ] **splay trees**
- https://www.coursera.org/learn/data-structures/lecture/O9nZ6/splay-trees - [ ] https://www.coursera.org/learn/data-structures/lecture/O9nZ6/splay-trees
- UCB: https://www.youtube.com/watch?v=G5QIXywcJlY - [ ] UCB: https://www.youtube.com/watch?v=G5QIXywcJlY
- https://www.youtube.com/watch?v=QnPl_Y6EqMo - [ ] https://www.youtube.com/watch?v=QnPl_Y6EqMo
- [ ] **red/black trees** - [ ] **red/black trees**
- https://class.coursera.org/algs4partI-010/lecture/50 - [ ] https://class.coursera.org/algs4partI-010/lecture/50
- [ ] **B-Trees** - [ ] **B-Trees**
- fun fact: B could stand for Boeing, Balanced, or Bayer (co-inventor) - fun fact: B could stand for Boeing, Balanced, or Bayer (co-inventor)
- https://en.wikipedia.org/wiki/B-tree - [ ] https://en.wikipedia.org/wiki/B-tree
- https://class.coursera.org/algs4partI-010/lecture/51 - [ ] https://class.coursera.org/algs4partI-010/lecture/51
- [ ] **2-3 search trees** - [ ] **2-3 search trees**
- 2-3 and B-trees: https://class.coursera.org/algs4partI-010/lecture/49 - [ ] 2-3 and B-trees: https://class.coursera.org/algs4partI-010/lecture/49
- https://www.youtube.com/watch?v=TOb1tuEZ2X4&index=5&list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp - [ ] https://www.youtube.com/watch?v=TOb1tuEZ2X4&index=5&list=PLUl4u3cNGP6317WaSNfmCvGym2ucw3oGp
- [ ] **N-ary trees** - [ ] **N-ary trees**
- https://en.wikipedia.org/wiki/K-ary_tree - https://en.wikipedia.org/wiki/K-ary_tree
@ -454,35 +472,15 @@ Then test it out on a computer to make sure it's not buggy from syntax.
- https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/PvlZW/core-performance-of-tries - https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/PvlZW/core-performance-of-tries
- https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/DFvd3/core-implementing-a-trie - https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/DFvd3/core-implementing-a-trie
- [ ] **Heap (data structure):**
- https://en.wikipedia.org/wiki/Heap_(data_structure)
- https://www.coursera.org/learn/data-structures/lecture/2OpTs/introduction
- https://www.coursera.org/learn/data-structures/lecture/z3l9N/naive-implementations
- https://www.coursera.org/learn/data-structures/lecture/GRV2q/binary-trees
- https://www.coursera.org/learn/data-structures/supplement/S5xxz/tree-height-remark
- https://www.coursera.org/learn/data-structures/lecture/0g1dl/basic-operations
- https://www.coursera.org/learn/data-structures/lecture/gl5Ni/complete-binary-trees
- https://www.coursera.org/learn/data-structures/lecture/HxQo9/pseudocode
- see: https://class.coursera.org/algs4partI-010/lecture
- https://class.coursera.org/algs4partI-010/lecture/39
- [ ] **Binary Heap:**
Min Heap / Max Heap
- [ ] **Disjoint Sets:** - [ ] **Disjoint Sets:**
- UCB: https://www.youtube.com/watch?v=wSPAjGfDl7Q&list=PL4BBB74C7D2A1049C&index=31 - [ ] https://en.wikipedia.org/wiki/Disjoint-set_data_structure
- https://www.coursera.org/learn/data-structures/lecture/JssSY/overview - [ ] UCB: https://www.youtube.com/watch?v=wSPAjGfDl7Q&list=PL4BBB74C7D2A1049C&index=31
- https://www.coursera.org/learn/data-structures/lecture/EM5D0/naive-implementations - [ ] https://www.coursera.org/learn/data-structures/lecture/JssSY/overview
- https://www.coursera.org/learn/data-structures/lecture/Mxu0w/trees - [ ] https://www.coursera.org/learn/data-structures/lecture/EM5D0/naive-implementations
- https://www.coursera.org/learn/data-structures/lecture/qb4c2/union-by-rank - [ ] https://www.coursera.org/learn/data-structures/lecture/Mxu0w/trees
- https://www.coursera.org/learn/data-structures/lecture/Q9CVI/path-compression - [ ] https://www.coursera.org/learn/data-structures/lecture/qb4c2/union-by-rank
- https://www.coursera.org/learn/data-structures/lecture/GQQLN/analysis-optional - [ ] https://www.coursera.org/learn/data-structures/lecture/Q9CVI/path-compression
- [ ] https://www.coursera.org/learn/data-structures/lecture/GQQLN/analysis-optional
- [ ] **Priority Queue**
- Notes:
- visualized as a tree, but is usually linear in storage (array, linked list)
- https://en.wikipedia.org/wiki/Priority_queue
- https://www.youtube.com/watch?v=yIUFT6AKBGE&index=24&list=PL4BBB74C7D2A1049C
## Graphs ## Graphs
@ -504,6 +502,7 @@ Then test it out on a computer to make sure it's not buggy from syntax.
- Graphs: - Graphs:
- https://www.youtube.com/watch?v=ylWAB6CMYiY&list=PL4BBB74C7D2A1049C&index=27 - https://www.youtube.com/watch?v=ylWAB6CMYiY&list=PL4BBB74C7D2A1049C&index=27
- https://www.youtube.com/watch?v=OiXxhDrFruw&index=11&list=PLOtl7M3yp-DV69F32zdK7YJcNXpTunF2b
- Weighted graphs: - Weighted graphs:
- https://www.youtube.com/watch?v=zFbq8vOZ_0k&list=PL4BBB74C7D2A1049C&index=28 - https://www.youtube.com/watch?v=zFbq8vOZ_0k&list=PL4BBB74C7D2A1049C&index=28
@ -532,6 +531,9 @@ You'll get more graph practice in Skiena's book (see Books section below) and th
- [ ] Which on arrays? Which on both? - [ ] Which on arrays? Which on both?
- [ ] Is Quicksort stable? - [ ] Is Quicksort stable?
- [ ] https://www.youtube.com/watch?v=yLvp-pB8mak&index=8&list=PLOtl7M3yp-DV69F32zdK7YJcNXpTunF2b
- [ ] https://www.youtube.com/watch?v=q7K9otnzlfE&index=9&list=PLOtl7M3yp-DV69F32zdK7YJcNXpTunF2b
- [ ] Implement: - [ ] Implement:
- [ ] Mergesort - [ ] Mergesort
- [ ] Quicksort - [ ] Quicksort
@ -664,9 +666,11 @@ You'll get more graph practice in Skiena's book (see Books section below) and th
#### Mentioned in Google Coaching: #### Mentioned in Google Coaching:
**Read and do exercises:**
- [ ] The Algorithm Design Manual (Skiena) - [ ] The Algorithm Design Manual (Skiena)
- Book (can rent on kindle): - Book (can rent on kindle):
- http://www.amazon.com/Algorithm-Design-Manual-Steven-Skiena/dp/1849967202 - http://www.amazon.com/Algorithm-Design-Manual-Steven-Skiena/dp/1849967202
- Half.com is a great resource for textbooks at good prices.
- Answers: - Answers:
- http://www.algorithm.cs.sunysb.edu/algowiki/index.php/The_Algorithms_Design_Manual_(Second_Edition) - http://www.algorithm.cs.sunysb.edu/algowiki/index.php/The_Algorithms_Design_Manual_(Second_Edition)
@ -674,8 +678,8 @@ You'll get more graph practice in Skiena's book (see Books section below) and th
http://www.amazon.com/Algorithms-Programming-Solutions-Alexander-Shen/dp/0817638474 http://www.amazon.com/Algorithms-Programming-Solutions-Alexander-Shen/dp/0817638474
Once you've understood everything in the daily plan, read and do exercises from Once you've understood everything in the daily plan, and read and done exercises from the the books above,
the books below. Then move to coding challenges (further down below) read and do exercises from the books below. Then move to coding challenges (further down below)
**Read first:** **Read first:**
@ -692,8 +696,12 @@ You'll get more graph practice in Skiena's book (see Books section below) and th
- [x] C++ Primer Plus, 6th Edition - [x] C++ Primer Plus, 6th Edition
- [ ] The Unix Programming Environment
- http://product.half.ebay.com/The-UNIX-Programming-Environment-by-Brian-W-Kernighan-and-Rob-Pike-1983-Other/54385&tg=info
- [ ] Introduction to Algorithms - [ ] Introduction to Algorithms
- https://www.amazon.com/Introduction-Algorithms-3rd-MIT-Press/dp/0262033844 - https://www.amazon.com/Introduction-Algorithms-3rd-MIT-Press/dp/0262033844
- Half.com is a great resource for textbooks at good prices.
- [ ] Programming Pearls: - [ ] Programming Pearls:
- http://www.amazon.com/Programming-Pearls-2nd-Jon-Bentley/dp/0201657880 - http://www.amazon.com/Programming-Pearls-2nd-Jon-Bentley/dp/0201657880
@ -777,6 +785,7 @@ More:
## Your Resume ## Your Resume
- http://steve-yegge.blogspot.co.uk/2007_09_01_archive.html - http://steve-yegge.blogspot.co.uk/2007_09_01_archive.html
- Great stuff at the back of Cracking The Coding Interview
## Be thinking of for when the interview comes: ## Be thinking of for when the interview comes: