Skip to content

aabdumalikov/sorting_algos

 
 

Repository files navigation

Sorting Algorithms Playground

Welcome to the Sorting Algorithms Playground! Here, you can explore different sorting algorithms and have some laughs along the way.

Algorithms Included

1. Bubble Sort

  • Time Complexity:
    • Best Case: O(n)
    • Worst Case: O(n^2)

2. Merge Sort

  • Time Complexity:
    • Best Case: O(n log n)
    • Worst Case: O(n log n)

3. Quick Sort

  • Time Complexity:
    • Best Case: O(n log n)
    • Worst Case: O(n^2)

4. Radix Sort (LSD)

  • Time Complexity:
    • Best Case: O(nk)
    • Worst Case: O(nk)

5. Insertion Sort

  • Time Complexity:
    • Best Case: O(n)
    • Worst Case: O(n^2)

6. Selection Sort

  • Time Complexity:
    • Best Case: O(n^2)
    • Worst Case: O(n^2)

Execution Time with Examples

Let's take an example list [5, 3, 9, 1, 4, 8, 6] and measure the execution time for each algorithm:

  • Bubble Sort: O(n^2) - Can be slow for large datasets.
  • Merge Sort: O(n log n) - Efficient for large datasets.
  • Quick Sort: O(n log n) - Efficient for large datasets, but worst-case scenario exists.
  • Radix Sort (LSD): O(nk) - Efficient for integers with a fixed number of digits.
  • Insertion Sort: O(n^2) - Simple, but less efficient for large datasets.
  • Selection Sort: O(n^2) - Simple, but less efficient for large datasets.

Feel free to explore and have fun with these sorting algorithms! 🚀

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%