LearnViz CompSci
Home / Learn / Algorithms

⚙️ Algorithms

Sorting, graphs, DP and beyond. 51 topics, from beginner to advanced.

Algorithms are step-by-step procedures for solving problems. This area covers searching and sorting, graph traversal, shortest paths, greedy methods, divide and conquer, dynamic programming and complexity analysis with Big-O notation. Learning them gives you a toolkit for choosing an approach and predicting how it will scale.

Who this area is for

Students preparing for technical interviews, developers who need faster solutions, and anyone who wants to reason about why one approach beats another.

Real-world use cases

Topics in Algorithms

Beginner (17)

Intermediate (17)

Advanced (17)

How to study Algorithms

Learn each algorithm by tracing it on a small input on paper before you read the code. State its time and space cost, then test a case where it performs badly. Use the Visual Lab sorting, graph and Big-O views to compare algorithms on the same input.

Frequently asked questions

What is Big-O notation?
Big-O describes how an algorithm’s running time or memory grows as input size grows. It ignores constant factors and focuses on the dominant term, so O(n log n) beats O(n²) for large n.
When should I use dynamic programming?
Use it when a problem splits into overlapping subproblems with optimal substructure, such as edit distance or knapsack. Storing subproblem results avoids recomputing them.
Is there one best sorting algorithm?
No. Quicksort is fast on average, merge sort is stable and predictable, and insertion sort is best for small or nearly sorted inputs. The right choice depends on the data and constraints.
Is it necessary to memorize every algorithm?
No. Understanding the pattern behind an algorithm, such as divide and conquer or greedy choice, lets you adapt it to new problems. Memorizing code is far less useful than recognizing when a pattern applies.
How do I know which algorithm to use?
Start from the constraints: input size, whether the data is sorted, and whether you need the best answer or a good-enough one. Then check the time complexity against those limits before writing code.

Open the interactive Algorithms area Take the Algorithms quiz

Other areas