Skip to content

Comparison of the runtime of array sorting algorithms 🗃️

License

Notifications You must be signed in to change notification settings

SinaRaoufi/array-sorting-algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Array sorting algorithms comparison

Comparison of the runtime of array sorting algorithms 🗃️

Array is one of the most popular data structures. One of the operations that can be operate on the array is the sort operation. The important point is that not all algorithms are optimal, and some algorithms may perform better than others. So it is important to know which algorithms are optimal and perform better.

Here we have examined the following sorting algorithms:

  • Bubble Sort
  • Selection Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort
  • Counting Sort
  • Radix Sort

result

Note: Comparing the elapsed time for each algorithm is not the right way to compare sorting algorithms and can only be useful to find an vision of the performance of algorithms.

In computer science, we use Time Complexity and Space Complexity to compare the performance of different algorithms. Time Complexity and Space Complexity for the above algorithms are as follows: result

Requirements

  • CMake
  • Makefile
  • C++ Compiler (GCC is recommended)
cmake . -B build

After the MakeFile was created:

make -C build