JavaScript Algorithms and Data Structures Masterclass
Essential Knowledge:
Data Structure | Algorithms | Concepts |
---|---|---|
ArrayLists | Merge Sort | Big O Time |
Hash Tables | Quick Sort | Big O Space |
Trees(+ Tries) | Breadth-First Search | Recursion |
Graphs | Depth-First Search | Memoization/Dynamic Programming |
Stacks/Queues | Binary Search | |
Heaps |
-
Big O Notation
- Time complexity
- Space complexity If not specified, talks about auxiliary space complexity which doesn't consider the space taken by the input)
-
Performance of JavaScript objects and arrays
-
Big O notation of object methods
Object.keys
- O(N)
Object.values
- O(N)
Object.entries
- O(N)
hasOwnProperty
- O(1) -
Big O notation of object operations
insertion - O(1)
removal - O(1)
updating - O(1)
access - O(1)
searching - O(N) for liner searching -
Big O notation of array operations
insertion - depends on where to insert (beginning, middle, end, etc.)
removal - depends on the position of elements to be removed (beginning, middle, end, etc.)
access - O(1)
searching - O(N) for liner searching -
Problem Solving Patterns
- Frequency Counters
- Multiple Pointers For instance, two pointer techniques will be illustrated in some code examples.
- Sliding Windows
-
Recursion (An important programming method)
-
Searching Algorithms
-
Sorting Algorithms (basic and intermediate algorithms)
What is data structure?
They are collections of values, relationship among them, and operations that can applied to them. Typical data structures in JavaScript: Array, Object,Graph, Trees etc.
- JavaScript Algorithms and Data Structure Masterclass by Colt Steele (Udemy)
- Cracking the Coding Interview (Gayle Laakmann)
- https://medium.com/@yanganif/tackling-javascript-algorithms-66f1ac9770dc
- https://github.com/benoitvallon/computer-science-in-javascript/tree/master/data-structures-in-javascript