This repository provides several classic algorithms and data structures in Computer Science, as well as some extra problems that are frequently encountered in programming challenges.
In order to achieve greater coverage and encourage more people to contribute to the project, the algorithms are available in the following languages: C, C++, Java, Python, Go, Ruby, Javascript, Swift, Rust, Scala, Kotlin and Elixir. You can quickly access an online compiler by clicking on the symbols corresponding to the desired programming languages in the top rows of each table.
Sorting Algorithms |
|
|
|
|
|
|
|
|
|
|
|
|
Bogosort |
|
|
|
|
|
|
|
|
|
|
|
|
Bubble Sort |
|
|
|
|
|
|
|
|
|
|
|
|
Bucket Sort |
|
|
|
|
|
|
|
|
|
|
|
|
Cocktail Sort |
|
|
|
|
|
|
|
|
|
|
|
|
Comb Sort |
|
|
|
|
|
|
|
|
|
|
|
|
Counting Sort |
|
|
|
|
|
|
|
|
|
|
|
|
Gnome Sort |
|
|
|
|
|
|
|
|
|
|
|
|
Heapsort |
|
|
|
|
|
|
|
|
|
|
|
|
Insertion Sort |
|
|
|
|
|
|
|
|
|
|
|
|
Merge Sort |
|
|
|
|
|
|
|
|
|
|
|
|
Quicksort |
|
|
|
|
|
|
|
|
|
|
|
|
Radix Sort |
|
|
|
|
|
|
|
|
|
|
|
|
Selection Sort |
|
|
|
|
|
|
|
|
|
|
|
|
Shell Sort |
|
|
|
|
|
|
|
|
|
|
|
|
Timsort |
|
|
|
|
|
|
|
|
|
|
|
|
Extra |
|
|
|
|
|
|
|
|
|
|
|
|
Queue using Stacks |
|
|
|
|
|
|
|
|
|
|
|
|
Two-Sum Problem |
|
|
|
|
|
|
|
|
|
|
|
|
Palindrome |
|
|
|
|
|
|
|
|
|
|
|
|
Isogram |
|
|
|
|
|
|
|
|
|
|
|
|
Leibniz Formula for Pi |
|
|
|
|
|
|
|
|
|
|
|
|
Maze-Solving Algorithm |
|
|
|
|
|
|
|
|
|
|
|
|
Rotten Oranges |
|
|
|
|
|
|
|
|
|
|
|
|
Find Distinct Subsets |
|
|
|
|
|
|
|
|
|
|
|
|
Feel free to contribute to the project, all contributions are welcome. ๐
If you have questions about how to contribute, take a look at the CONTRIBUTING file.
๐ผ Back to top