Section 06 ยท Stage 2: Master DSA
Data Structures & Algorithms in Java
Linked lists, stacks, queues, trees, heaps, tries, graphs, sorting, greedy algorithms and dynamic programming, built and used in Java.
What you will be able to do
- Build linked lists, stacks, queues, trees, heaps and tries from scratch in Java
- Choose between Java's built-in collections and your own structure for a problem
- Implement and compare the main sorting algorithms
- Solve tree and graph problems with DFS, BFS, shortest paths, topological sort and union-find
- Recognise greedy and interval problems and know when greedy fails
- Turn recursive solutions into dynamic programming, from 1D to 2D
What you will learn
6.1Linked Lists10 lessons
Write your own singly and doubly linked lists and solve the pointer questions interviews love.
6.2Stacks & Queues11 lessons
Implement stacks and queues yourself and use the monotonic stack for next greater style problems.
- Stacks: last in, first out25 min
- Build a stack yourself28 min
- Balanced brackets25 min
- Queues: first in, first out25 min
- Build a circular queue28 min
- Min stack and a queue from stacks30 min
- Evaluating expressions30 min
- Monotonic stack32 min
- Largest rectangle in a histogram32 min
- Deques28 min
- Practice: stacks and queues32 min
6.3Hash Tables from Scratch8 lessons
Build your own hash map to understand why HashMap is fast, and when it is not.
6.4Sorting Algorithms10 lessons
How the main sorts work, what they cost and how Java's own sort fits in.
6.5Binary Trees10 lessons
- Trees and tree words25 min
- Preorder, inorder and postorder25 min
- Traversals with a stack25 min
- Level order traversal25 min
- Height, diameter and balance25 min
- Paths in trees30 min
- Lowest common ancestor32 min
- Tree views, boundary and vertical order35 min
- Build and serialize trees35 min
- Practice: binary trees30 min
6.10Advanced Graph Algorithms9 lessons
6.12Dynamic Programming (1D)11 lessons
- What dynamic programming is25 min
- Memoization25 min
- Tabulation25 min
- The DP recipe30 min
- Climbing stairs and house robber30 min
- Coin change30 min
- Decode ways and word break30 min
- Longest increasing subsequence30 min
- Saving space in DP25 min
- Best Time to Buy and Sell Stock30 min
- 1D Dynamic Programming Practice35 min
6.13Dynamic Programming: 2D & Common Families9 lessons
6.14Advanced Dynamic Programming9 lessons
- Interval dynamic programming35 min
- Bitmask dynamic programming35 min
- Tree dynamic programming35 min
- Digit dynamic programming35 min
- Game theory dynamic programming35 min
- Classic hard dynamic programming35 min
- DP optimisations: prefix sums and monotonic queues35 min
- Matrix exponentiation: linear recurrences in logarithmic time35 min
- Comprehensive advanced DP practice40 min
