inflearn logo

Algorithms from Scratch: The Java Edition — Completing CLRS

This time, we’re going to complete the algorithms from start to finish. We’ll work through the CLRS algorithm textbook (MIT Press)—used as a textbook at universities around the world and with over one million copies sold—implementing each algorithm ourselves in Java as we go.

5 learners are taking this course

Level Intermediate

Course period Unlimited

Java
Java
Algorithm
Algorithm
data-structure
data-structure
Dynamic Programming
Dynamic Programming
Graph Algorithms
Graph Algorithms
Java
Java
Algorithm
Algorithm
data-structure
data-structure
Dynamic Programming
Dynamic Programming
Graph Algorithms
Graph Algorithms

What you will gain after the course

  • My code implementing the data structures and algorithms from the CLRS textbook in Java from scratch.

  • The ability to explain how ArrayList, HashMap, and TreeMap work internally.

  • The ability to work out for yourself why it’s O(n log n) using recurrence relations and amortized analysis

  • The ability to implement advanced data structures such as segment trees, tries, and disjoint-set structures from scratch.

  • Criteria for choosing between brute force, backtracking, dynamic programming, and greedy algorithms when faced with a problem for the first time.

  • Experience implementing graph algorithms ranging from BFS and DFS to shortest paths and maximum flow.

  • The ability to figure out why AI-generated code is slow and fix it

Finish CLRS, Master Algorithms

If you’ve started studying algorithms several times but always got stuck in the early chapters, let’s make it all the way to the end this time.

Starting with complexity analysis and covering sorting, trees, hash tables, dynamic programming, graphs, and maximum flow. Follow the structure of the CLRS algorithms textbook and implement each topic yourself in Java, completing the journey from beginning to end.

Completing CLRS gives you a complete foundation in algorithms. You’ll have a mental map to find and apply what you need, without wondering what to study next.


Back to basics.

Tools are constantly changing. Languages, frameworks, and now even AI that writes code. But the data structures and algorithms beneath them remain the same. In the age of AI, what ultimately mattered was the fundamentals.

This course isn’t about adding one more new thing—it’s about going back to the basics. Starting with arrays and linked lists, we’ll work through the topics covered in an algorithms textbook, building each one ourselves along the way.


CLRS, what page did you stop at?

It’s the MIT Press book *Introduction to Algorithms*, known as CLRS after the initials of its four authors: Cormen, Leiserson, Rivest, and Stein.

Used as an algorithms textbook at universities around the world, it has sold over 1 million copies to date. It’s the kind of book developers tell themselves, “I’ll finish it someday.”

But many people never make it past the first few chapters before closing the book. It’s not because the book is bad. It’s because the math can feel unfamiliar when you’re reading alone, and pseudocode doesn’t become second nature just by looking at it.

This course is an invitation to finish that book together this time.


Machines may write the code, but people make the decisions.

These days, AI writes code for us. Sorting algorithms, hash tables, balanced search trees—all it takes is a one-line prompt, and they’re ready in seconds. Machines are already better than humans at implementing algorithms accurately and efficiently.

But who will judge whether that code is correct, why it’s slow, and which data structure is best suited to this data? Deciding whether to use the code the machine produces as-is or ask it to make changes is still up to people. And we can make that judgment only to the extent that we understand the algorithms.

The more implementation machines take on, the deeper understanding people need. To clearly specify what to ask for, validate the results they return, and suggest better approaches, we need to understand the underlying principles.

This course helps you develop the judgment to make those decisions. That’s also why you’ll implement the algorithms yourself. Having built a data structure by hand at least once helps you know what to look for when reading AI-generated code. Of course, the course also covers frequently tested coding interview topics such as Upper and Lower Bound in binary search, segment trees, disjoint-set data structures, and bitmasking, making it a solid foundation for anyone preparing for coding tests.


How This Course Helps You Get Through CLRS

1. Follow Each Step Visually

Follow each step of how the algorithm works on the slides. See exactly when and how each array slot and pointer changes, then move on to the code.

2. We implement it directly in Java.

We start by naming it MyArrayList to distinguish it from Java’s ArrayList library. This isn’t a course where you read finished code; we build it together from scratch.

3. We work through why it is so together.

Complexity is something to understand, not memorize. We’ll set up and solve a recurrence to see why merge sort is O(n log n), and analyze Karatsuba multiplication and Strassen matrix multiplication using the Master Theorem. We’ll carefully cover only the proofs essential to understanding algorithms, such as the max-flow min-cut theorem.


Things to Know Before Taking the Course

  • Practice environment: Java 8 or later is required. The course uses IntelliJ IDEA, but any IDE is fine.

  • Textbook: The course is based on the original English edition of CLRS (Introduction to Algorithms, 4th Edition). The lecture materials are sufficient to follow along, so you don’t need to buy the book separately. In particular, the Korean translation contains many mistranslations, so I don’t recommend buying it. If you do decide to get the book, I recommend the original English edition.


About the Knowledge Sharer

Hello, I’m Rodin. I teach algorithms under the name “Rodin’s Thinking Algorithms.”

  • Master’s degree in Computer Science from Georgia Tech

  • Artificial Intelligence & Data Engineering Course at Samsung Youth Software AI Academy

  • Selected as the top instructor for AI competencies at the Samsung Software and AI Academy for Youth

Teaching artificial intelligence has made one thing even clearer to me: in the end, the fundamentals are what matter. That’s why, in this course, I want to give you an understanding that lasts, rather than just show you how to solve problems quickly.

CLRS—this time, let’s work through it together instead of reading it alone.



Curriculum at a Glance


View the Curriculum in Detail

1. Algorithm Fundamentals

  • Complexity Analysis: Learn the asymptotic notations O, Ω, and Θ.

  • Recursion: Learn about recursive functions.

  • Binary Search: Implement binary search recursively and iteratively, and implement Upper and Lower.

2. Linear Data Structures

  • Array List: Learn about the collection and list interfaces and iterators, then implement an array list. Learn amortized analysis.

  • Linked Lists: Design a linked list using a class diagram and implement an iterator as well.

  • Stacks, queues, and circular queues: Implement stacks and queues using both arrays and linked lists, and implement a circular queue using an array.

3. Sorting

  • Basic Sorting: Implement bubble, selection, and insertion sort.

  • Linear-time sorting: Implement counting sort, radix sort, and bucket sort.

  • Merge Sort: Implement merge sort.

  • Quick sort: Implement quicksort using three methods: Lomuto partition, Hoare partition, and Dutch flag partition.

  • Heap sort: Implement heap sort.


4. Algorithm Design Techniques

  • Divide and Conquer: Learn the Master Theorem, Karatsuba multiplication, Strassen’s matrix multiplication, and selecting the kth element.

  • Brute-force search: Learn permutations, combinations, subsets, and bitmasking.

  • Backtracking: Learn backtracking with the N-Queens problem.

  • Dynamic Programming: Learn and implement rod cutting, memoization and tabulation, the longest increasing subsequence (LIS), the longest common subsequence (LCS), 0-1 Knapsack, and matrix chain multiplication.

  • Greedy Algorithms: Learn the meeting room scheduling problem and Huffman coding.

5. Trees

  • Trees and Binary Trees: Learn about trees and binary trees, and implement binary tree traversal.

  • Binary Heaps: Learn how to insert into and delete from a binary heap, and implement a max heap.

  • Segment Tree: Implement range queries, value updates, and lazy propagation.

  • Binary search tree: Implement search, insertion, deletion, and rotations in a binary search tree.

  • AVL tree: Implement insertion and deletion in an AVL tree.

  • Red-Black Trees: Learn the properties of red-black trees.

  • 2-3 Trees: Learn how to insert into and delete from 2-3 trees.

  • LLRB Tree: Implement insertion and deletion in an LLRB tree.

  • B-Trees and B+ Trees: Learn about B-trees and B+ trees.

  • Trie: Implement a trie.

6. Hash Tables and Disjoint Sets

  • Hash tables: Learn and implement hash functions, separate chaining, linear probing, and quadratic probing.

  • Disjoint sets: Learn and implement Make-Set, Find, Union, path compression, and Union by rank.

7. Graphs

  • Graph Fundamentals: directed and undirected graphs, paths and cycles, complete graphs, bipartite graphs, DAGs, weighted graphs

  • Graph Representations: Implement adjacency matrices and adjacency lists.

  • Graph Traversal: Learn BFS and DFS.

  • Topological sorting: DFS-based method, Kahn's algorithm

  • Strongly Connected Components: Kosaraju’s algorithm

  • Minimum Spanning Trees: Kruskal, Prim

  • Shortest paths: Bellman–Ford, Dijkstra, Floyd–Warshall

  • Maximum flow: Ford–Fulkerson, Edmonds–Karp, max-flow min-cut theorem

Recommended for
these people

Who is this course right for?

  • For those who want a comprehensive review of algorithms from start to finish at the undergraduate to graduate level.

  • Anyone who bought CLRS and stopped in the early chapters

  • Someone who can solve coding test problems but has trouble explaining why their solutions are correct.

  • Someone who uses HashMap and TreeMap but doesn’t know what happens under the hood.

  • For those who aren’t sure why AI-generated code is slow or what needs fixing.

Need to know before starting?

  • Java Basics (Classes, Methods, Arrays, Loops)

Hello
This is rodin

Career Verified

Hello, I’m Rodin 🙂

In “Rodin’s Thinking Algorithms,” we look at algorithms through diagrams, implement them ourselves in code, and think them through together. I’m creating lessons that go beyond memorizing algorithms and moving on—we follow the reasoning all the way to understand why they work.

  • Master’s in Computer Science from Georgia Tech

  • Artificial Intelligence and Data Engineering Course at Samsung Youth Software and AI Academy (SSAFY)

  • Top-Rated AI Instructor Selected by SSAFY

More

Curriculum

All

338 lectures ∙ (31hr 16min)

Course Materials:

Lecture resources
Published: 
Last updated: 

Reviews

Not enough reviews.
Please write a valuable review that helps everyone!

Similar courses

Explore other courses in the same field!

Limited time deal

$11,106.00

34%

$102.30