In: Computer Science
PYTHON Perform a series of benchmarking tests on merge-sort and quick-sort to determine which one is faster. Your tests should include sequences that are “random” as well as “almost” sorted.
merge-sort refers to radam sorting techinque:
1.merge sort will divide the given array in two array
2.after that sort the two array separately
3.after that we merge these two array's ...
By considered these points we can declare it as randomly sorted
when we divided in two array's what happens?
1.the arrays are sorted irrespective of elements
2.irrespective of elements also merging wil be done
so that we can chose randomly sorted.
quick-sort refers to sequence sorting techinque:
1.quick sort will not divide the given array in two array
2.the sorting the array by checking each and every element by iteration wise
3.after that we get almost all elemnts are sorted
By considered these points we can declare it as sequence sorted
when we consider this technique what happens?
1.the array is sorted respective of elements.
2.altmost the array will be sorted
so that we can chose almost sorted.
Hence we can declare quick sort will be more efficent.