Learn Algorithms
Visually
Step-by-step animated visualizations for data structures and algorithms. Watch code execute in real time.
Showing 58 algorithms
Sorting
6Algorithms that arrange elements in a specific order — fundamental to computer science
Bubble Sort
Sort an array by repeatedly swapping adjacent elements that are in the wrong order
Selection Sort
Sort an array by repeatedly finding the minimum element and placing it at the beginning
Insertion Sort
Build a sorted portion by inserting each element into its correct position one at a time
Iterative Merge Sort
Sort an array using bottom-up merge operations without recursion
Heap Sort
Sort an array by building a max heap and repeatedly placing the largest element at the end
Explore all problems
Array
27Array manipulation techniques — rotating, searching, and rearranging elements efficiently
Rotate Array
Rotate an array to the right by k steps using the efficient reversal algorithm.
Move Zeros
Move all zeros to the end while preserving the relative order of non-zero elements.
Remove Duplicates from Sorted Array
Remove duplicates from a sorted array in-place so each unique element appears once.
Two Sum
Find two indices in the array such that their values add up to a given target using an efficient hash map approach.
Best Time to Buy and Sell Stock
Find the maximum profit by choosing one day to buy and a later day to sell.
Explore all problems
Linked List
1Operations on linked data structures — traversal, reversal, and merging
Tree
1Hierarchical data structure operations — traversal, search, and balancing
Graph
1Graph traversal and shortest path algorithms — BFS, DFS, and more
Stack & Queue
1LIFO and FIFO data structure operations and applications
Dynamic Programming
1Solving complex problems by breaking them into overlapping subproblems
String
18String manipulation and pattern matching algorithms
Reverse String
Reverse a string in-place using the two-pointer technique, swapping characters from both ends
Longest Common Prefix
Find the longest common prefix among all strings.
Roman to Integer
Convert a Roman numeral string into its integer value.
Isomorphic Strings
Check whether two strings can be transformed using a one-to-one character mapping.
Encode and Decode Strings
Encode a list of strings into one string and decode it back safely.
Explore all problems