Split Linked Lists over 2 days.
This commit is contained in:
parent
6472d3d1be
commit
bba72aab57
57
plan.txt
57
plan.txt
@ -101,7 +101,7 @@ Each day I take one subject from the list below, watch videos about that subject
|
|||||||
C - using structs and functions that take a struct * and something else as args.
|
C - using structs and functions that take a struct * and something else as args.
|
||||||
C++ - without using built-in types
|
C++ - without using built-in types
|
||||||
C++ - using built-in types, like STL's std::list for a linked list
|
C++ - using built-in types, like STL's std::list for a linked list
|
||||||
Python - without using built-in types (to keep practicing Python)
|
Python - using built-in types (to keep practicing Python)
|
||||||
and write tests to ensure I'm doing it right, sometimes just using simple assert() statements
|
and write tests to ensure I'm doing it right, sometimes just using simple assert() statements
|
||||||
You may do Java or something else, this is just my thing.
|
You may do Java or something else, this is just my thing.
|
||||||
|
|
||||||
@ -110,6 +110,8 @@ Why code in all of these?
|
|||||||
Work within the raw constraints (allocating/freeing memory without help of garbage collection (except Python))
|
Work within the raw constraints (allocating/freeing memory without help of garbage collection (except Python))
|
||||||
Make use of built-in types so I have experience using the built-in tools for real-world use (not going to write my own linked list implementation in production)
|
Make use of built-in types so I have experience using the built-in tools for real-world use (not going to write my own linked list implementation in production)
|
||||||
|
|
||||||
|
I may not have time to do all of these for every subject, but I'll try.
|
||||||
|
|
||||||
You don't need to memorize the guts of every algorithm.
|
You don't need to memorize the guts of every algorithm.
|
||||||
|
|
||||||
Write code on a whiteboard, not a computer. Test with some sample inputs.
|
Write code on a whiteboard, not a computer. Test with some sample inputs.
|
||||||
@ -138,7 +140,7 @@ Then test it out on a computer to make sure it's not buggy from syntax.
|
|||||||
- Amortized Analysis: https://www.youtube.com/watch?v=B3SpQZaAZP4&index=10&list=PL1BaGV1cIH4UhkL8a9bJGG356covJ76qN
|
- Amortized Analysis: https://www.youtube.com/watch?v=B3SpQZaAZP4&index=10&list=PL1BaGV1cIH4UhkL8a9bJGG356covJ76qN
|
||||||
- Illustrating "Big O": https://class.coursera.org/algorithmicthink1-004/lecture/63
|
- Illustrating "Big O": https://class.coursera.org/algorithmicthink1-004/lecture/63
|
||||||
- Cheat sheet: http://bigocheatsheet.com/
|
- Cheat sheet: http://bigocheatsheet.com/
|
||||||
Arrays
|
* - Arrays: (Implement an automatically resizing vector)
|
||||||
* - Description:
|
* - Description:
|
||||||
- Arrays: https://www.coursera.org/learn/data-structures/lecture/OsBSF/arrays
|
- Arrays: https://www.coursera.org/learn/data-structures/lecture/OsBSF/arrays
|
||||||
- Arrays: https://www.lynda.com/Developer-Programming-Foundations-tutorials/Basic-arrays/149042/177104-4.html
|
- Arrays: https://www.lynda.com/Developer-Programming-Foundations-tutorials/Basic-arrays/149042/177104-4.html
|
||||||
@ -173,36 +175,36 @@ Arrays
|
|||||||
* - Space
|
* - Space
|
||||||
- contiguous in memory, so proximity helps performance
|
- contiguous in memory, so proximity helps performance
|
||||||
- space needed = (array capacity, which is >= n) * size of item, but even if 2n, still O(n)
|
- space needed = (array capacity, which is >= n) * size of item, but even if 2n, still O(n)
|
||||||
Linked lists
|
Singly Linked List
|
||||||
- singly-linked
|
* - Description:
|
||||||
* - Description: https://www.coursera.org/learn/data-structures/lecture/kHhgK/singly-linked-lists
|
* - https://www.coursera.org/learn/data-structures/lecture/kHhgK/singly-linked-lists
|
||||||
* - Lynda.com:
|
* - Lynda.com:
|
||||||
- https://www.lynda.com/Developer-Programming-Foundations-tutorials/Introduction-lists/149042/177115-4.html
|
- https://www.lynda.com/Developer-Programming-Foundations-tutorials/Introduction-lists/149042/177115-4.html
|
||||||
- https://www.lynda.com/Developer-Programming-Foundations-tutorials/Understanding-basic-list-implementations/149042/177116-4.html
|
- https://www.lynda.com/Developer-Programming-Foundations-tutorials/Understanding-basic-list-implementations/149042/177116-4.html
|
||||||
- https://www.lynda.com/Developer-Programming-Foundations-tutorials/Using-singly-doubly-linked-lists/149042/177117-4.html
|
- https://www.lynda.com/Developer-Programming-Foundations-tutorials/Using-singly-doubly-linked-lists/149042/177117-4.html
|
||||||
- https://www.lynda.com/Developer-Programming-Foundations-tutorials/List-support-across-languages/149042/177118-4.html
|
- https://www.lynda.com/Developer-Programming-Foundations-tutorials/List-support-across-languages/149042/177118-4.html
|
||||||
* - C Code: https://www.youtube.com/watch?v=QN6FPiD0Gzo
|
* - C Code: https://www.youtube.com/watch?v=QN6FPiD0Gzo
|
||||||
- not the whole video, just portions about Node struct and memory allocation.
|
- not the whole video, just portions about Node struct and memory allocation.
|
||||||
* - why you should avoid linked lists:
|
* - why you should avoid linked lists:
|
||||||
- https://www.youtube.com/watch?v=YQs6IC-vgmo
|
- https://www.youtube.com/watch?v=YQs6IC-vgmo
|
||||||
- implement (with tail pointer), item is the data item in a node:
|
- implement (with tail pointer):
|
||||||
- push_front
|
* - size() - returns number of data elements in list
|
||||||
- get_front
|
* - empty() - bool returns true if empty
|
||||||
- pop_front
|
* - front() - get value of front item
|
||||||
- insert_before(node, value)
|
* - back() - get value of end item
|
||||||
- insert_after(node, value)
|
* - push_front(value) - adds an item to the front of the list
|
||||||
- size()
|
* - pop_front() - remove front item
|
||||||
- is_empty()
|
* - push_back(value) - adds an item at the end
|
||||||
- find(value) - assume each item is unique
|
* - pop_back() - removes end item
|
||||||
- remove(value) - assume each item is unique
|
- insert(index, value) - insert value at index, so current item at that index is pointed to by next at index
|
||||||
- reverse - reverses the list
|
- erase(index) - removes node at given index
|
||||||
- doubly-linked list
|
- remove(value) - remove all elements with this value
|
||||||
|
- find(value) - return pointer to the node that has this value
|
||||||
|
- reverse() - reverses the list
|
||||||
|
Doubly-linked List
|
||||||
- Description: https://www.coursera.org/learn/data-structures/lecture/jpGKD/doubly-linked-lists
|
- Description: https://www.coursera.org/learn/data-structures/lecture/jpGKD/doubly-linked-lists
|
||||||
- implement:
|
- implement:
|
||||||
- same as above for singly linked list
|
- same as above for singly linked list
|
||||||
- push_back()
|
|
||||||
- get_back()
|
|
||||||
- pop_back()
|
|
||||||
Stacks
|
Stacks
|
||||||
- see: https://class.coursera.org/algs4partI-010/lecture
|
- see: https://class.coursera.org/algs4partI-010/lecture
|
||||||
- https://www.coursera.org/learn/data-structures/lecture/UdKzQ/stacks
|
- https://www.coursera.org/learn/data-structures/lecture/UdKzQ/stacks
|
||||||
@ -210,7 +212,9 @@ Queues
|
|||||||
- see: https://class.coursera.org/algs4partI-010/lecture
|
- see: https://class.coursera.org/algs4partI-010/lecture
|
||||||
- https://www.coursera.org/learn/data-structures/lecture/EShpq/queues
|
- https://www.coursera.org/learn/data-structures/lecture/EShpq/queues
|
||||||
Heaps
|
Heaps
|
||||||
- https://www.coursera.org/learn/data-structures/lecture/GRV2q/binary-trees
|
- Description:
|
||||||
|
- https://en.wikipedia.org/wiki/Heap_(data_structure)
|
||||||
|
- https://www.coursera.org/learn/data-structures/lecture/GRV2q/binary-trees
|
||||||
- min heap
|
- min heap
|
||||||
- max heap
|
- max heap
|
||||||
Priority Queue
|
Priority Queue
|
||||||
@ -385,6 +389,9 @@ Once you're closer to the interview:
|
|||||||
|
|
||||||
Extras that can't hurt:
|
Extras that can't hurt:
|
||||||
|
|
||||||
|
Computer Security:
|
||||||
|
- MIT (23 videos): https://www.youtube.com/playlist?list=PLUl4u3cNGP62K2DjQLRxDNRi0z2IRWnNh
|
||||||
|
|
||||||
Information theory:
|
Information theory:
|
||||||
- Markov processes:
|
- Markov processes:
|
||||||
- https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/waxgx/core-markov-text-generation
|
- https://www.coursera.org/learn/data-structures-optimizing-performance/lecture/waxgx/core-markov-text-generation
|
||||||
|
Loading…
x
Reference in New Issue
Block a user