Algorithm Visualizer
An interactive tool to visualize and understand how sorting algorithms work. See the algorithms in action and learn about their performance characteristics.
About This Project
This project provides interactive visualizations for common sorting algorithms, helping you understand how they work through visual animations.
Each visualization allows you to:
- See step-by-step how the algorithm sorts data
- Control the animation speed
- Adjust the dataset size
- Learn about time and space complexity
Available Algorithms
Selection Sort
Selection Sort is a simple comparison-based sorting algorithm. It works by dividing the input list into two parts: a sorted sublist and an unsorted sublist. The algorithm repeatedly finds the minimum element from the unsorted sublist and moves it to the end of the sorted sublist.
Insertion Sort
Insertion Sort builds the final sorted array one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort, but it performs well for small datasets or nearly sorted datasets.
Bubble Sort
Bubble Sort is a simple comparison-based sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.
Merge Sort
Merge Sort is an efficient, stable, divide-and-conquer sorting algorithm. It works by dividing the array into halves, sorting each half, and then merging them back together. The merge operation efficiently combines two sorted arrays into one.
Counting Sort
Counting Sort is an integer sorting algorithm that works by counting the occurrences of each element, then using that information to determine their positions in the output sequence. It's efficient when the range of potential items is not significantly greater than the number of items.