Skip to content

Which sorting algorithm grows faster with the time complex data size or the space complex grows faster. In this project, we compared the time and space complexities of counting_sort, heap_sort, quick_sort, insertion_sort and merge_sort algorithms.

Notifications You must be signed in to change notification settings

newsteps8/Efficiency_of_SortingAlgorithms

Repository files navigation

Efficiency_of_SortingAlgorithms

Which sorting algorithm grows faster with the time complex data size or the space complex grows faster. In this project, we compared the time and space complexities of counting_sort, heap_sort, quick_sort, insertion_sort and merge_sort algorithms.

I used big O O() for time complexity.

I used worst case,best case and avarage case files as input files.

Analyzing Results:

*Insertion sort gives the best performance for the ascending or descending ordered inputs ,however quick sort gives the worst performance for these inputs.

  • Insertion sort is less efficient on large size input lists than quicksort, heapsort, or merge sort algorithms. However insertion sort is more efficient on small size input lists than other algorithms. *Merge sort can be applied files of any size. But merge sort less efficient than other sort. *Quick sort is very efficient algorithms. because it gives best performance on large list of inputs.But it gives worst performance on ascending or descending ordered input lists.
  • Disadvantage of quick sort is that its worst-case performance is similar to average case performances of the insertion sort.
  • Heap sort is very efficiency algorithms. This means it performs equally well in the best, average and worst cases.
  • Merge sort and heap sort are independent of distribution of inputs.
  • Counting sort is more efficient if the range of inputs is smaller and inefficient for large inputs. Space complexity is change according to range of inputs.

About

Which sorting algorithm grows faster with the time complex data size or the space complex grows faster. In this project, we compared the time and space complexities of counting_sort, heap_sort, quick_sort, insertion_sort and merge_sort algorithms.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages