Go deeper in Java
Java Algorithms
Implement classic algorithms and data structures in Java yourself: sorting, searching, trees and graphs. Tests check every solution right away.
Sign up for free
0 of 84 solved
Without an account you can try the first tasks. Your progress then stays in this browser.
Who is this course for?
For anyone who already knows the Java basics (loops, methods, classes) and wants to go deeper for a university course, exam or job application.
What you will be able to do
- Understand sorting and searching methods and program them yourself
- Implement lists, stacks, trees and graphs
- Estimate the running time of solutions and pick the right data structure
8 chapters, 84 tasks
Each chapter builds on the previous one. Free and Pro chapters are marked.
Chapter 1 · SearchingPro0/11 solved
- Lesson: Searching
- Linear SearchEasy
- Last Occurrence and CountEasy
- Pseudocode: Linear SearchEasy
- Position of Minimum and MaximumEasy
- Search in a 2D ArrayMedium
- Binary SearchMedium
- What Does This Print? Binary Search Step by StepMedium
- Find the Bug: Binary SearchMedium
- Recursive Binary SearchMedium
- Lower Bound and CountHard
- Search in a Sorted MatrixHard
Chapter 2 · Simple Sorting AlgorithmsPro0/11 solved
- Lesson: Simple Sorting Algorithms
- Swapping two elementsEasy
- Is the array sorted?Easy
- One pass of bubble sortEasy
- What does this print? Bubble sort step by stepMedium
- Bubble sort with early exitMedium
- Find the bug: bubble sortMedium
- Pseudocode: selection sortMedium
- Insertion sortMedium
- Counting comparisons and swapsMedium
- Sorting words by lengthHard
- Sorting a ranking stablyHard
Chapter 3 · Fast Sorting AlgorithmsPro0/10 solved
- Lesson: Fast Sorting Algorithms
- Merging two sorted arraysEasy
- Merge SortMedium
- What does this print? Merge Sort splits upMedium
- Find the bug: MergeMedium
- Pseudocode: MergeMedium
- Lomuto partitionEasy
- QuicksortMedium
- Counting Sort for exam pointsMedium
- Stable sorting by gradeHard
- Quickselect: the k-th smallest elementHard
Chapter 4 · Classic AlgorithmsPro0/10 solved
- Lesson: Classic Algorithms
- GCD with EuclidEasy
- LCM via the GCDEasy
- What does this print? Desk check EuclidMedium
- Pseudocode: Prime testMedium
- Sieve of EratosthenesMedium
- Converting number systemsMedium
- Find the bug: Binary numberMedium
- Luhn check digitMedium
- Change with the greedy methodHard
- Roman numerals there and backHard
Chapter 5 · Lists, Stacks and QueuesPro0/10 solved
- Lesson: Lists, Stacks and Queues
- A stack with an arrayEasy
- What does this print? push and popMedium
- Pseudocode: checking bracketsMedium
- A queue with a ring bufferMedium
- Find the bug: queueMedium
- Linked list: append and countEasy
- Linked list: read and removeMedium
- A queue with linked nodesMedium
- Reversing a linked listHard
- Final task: postfix calculatorHard
Chapter 6 · Recursion and BacktrackingPro0/10 solved
- Lesson: Recursion and Backtracking
- Reversing a text recursivelyEasy
- Summing an array recursivelyEasy
- Find the bug: factorialEasy
- What does this print? Call orderMedium
- Pseudocode: Towers of HanoiMedium
- All arrangements of a wordMedium
- All subsetsMedium
- Filling areas like the paint bucketMedium
- A way through the mazeHard
- Final task: the n-queens problemHard
Chapter 7 · Trees and HeapsPro0/11 solved
- Lesson: Trees and Heaps
- Counting the nodes in a treeEasy
- Height of a treeEasy
- Sum of the leavesEasy
- Pseudocode: inorderEasy
- Preorder and postorderMedium
- What does this print? TraversalMedium
- Binary search tree: insert and searchMedium
- Find the bug: inserting into a search treeMedium
- Min-heap on an arrayMedium
- Is this a search tree?Hard
- HeapsortHard
Chapter 8 · Hashing and GraphsPro0/11 solved
- Lesson: Hashing and Graphs
- Hash value of a stringEasy
- Counting collisionsEasy
- Building an adjacency listEasy
- Hash table with chainingMedium
- Breadth-first searchMedium
- Depth-first searchMedium
- What does this print? Breadth-first searchMedium
- Find the bug: the visited markMedium
- Pseudocode: breadth-first searchMedium
- Counting connected componentsHard
- Shortest paths with DijkstraHard