Skip to content

Andrei137/Sorting-Visualizer

Repository files navigation

Sorting Visualizer

About

A simple sorting visualizer made using C++ and SFML. The project includes 24 algorithms, grouped by complexity. The user can choose the size of the array, the initial order of the array and the algorithm to be used. The project also includes a timer, which appears afer the algorithm finishes. Keep in mind that the timer shows how long it took to display the process, not how long it took to sort the array.

Usage

  • Windows
run.bat
SortingVisualizer

Algorithms

O(n^2)

  • Bubble Sort
  • Cocktail Sort
  • Cycle Sort
  • Gnome Sort
  • Insertion Sort
  • Odd-Even Sort
  • Pancake Sort
  • Selection Sort
  • Selection Sort (Exchange Variation)

O(n * log_n)

  • Heap Sort
  • Intro Sort
  • Merge Sort
  • Quick Sort (Lomuto partition scheme)
  • Quick Sort (Hoare partition scheme)
  • Shell Sort
  • Smooth Sort
  • Tim Sort
  • Tree Sort

Other complexities

  • Bogo Sort - O((n + 1)!)
  • Comb Sort - O(n^2 / 2^p)
  • Cycle Sort on [1..n] array - O(n)
  • Pigeonhole Sort - O(n + Range)
  • Radix Sort - O(d * (n + b))
  • Stooge Sort - O(n^2.7)

Options

Array Size

  • Default size for every algorithm
  • Custom size given by user

Array Initial Order

  • Random Shuffle (default)
  • Partially Sorted
  • Nearly Sorted
  • Decreasing Order
  • Increasing Order

Credits

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages