Question

In: Computer Science

PYTHON Perform a series of benchmarking tests on merge-sort and quick-sort to determine which one is...

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.

Solutions

Expert Solution

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.


Related Solutions

Which of the following sorting algorithms are stable: insertion sort, selection sort, merge sort and quick...
Which of the following sorting algorithms are stable: insertion sort, selection sort, merge sort and quick sort? Give a simple scheme that makes any sorting algorithm stable. How much additional time and space does your scheme entail?
Write a program in Java to sort the given array using merge sort, quick sort, insertion...
Write a program in Java to sort the given array using merge sort, quick sort, insertion sort, selection sort and bubble sort based on the input from the user which sorting technique they wanted to use. Get the array size, array elements from the user, and also display the sorted array along with the name of the sorting technique used.
2 real-time examples on the Insertion sort, Bubble sort, Selection sort, Quick sort, Shell sort, Merge...
2 real-time examples on the Insertion sort, Bubble sort, Selection sort, Quick sort, Shell sort, Merge sort, Radix sort, Bucket sort, and Counting sort.
1.)recursive merge sort on a list.(Python) 2.)recursive bubble sort using a list without enumerate() function.(python) Show...
1.)recursive merge sort on a list.(Python) 2.)recursive bubble sort using a list without enumerate() function.(python) Show Base case, and recursive case.
a. Develop a divide-and-conquer algorithm to perform a parallel merge sort of an array. Hint: After...
a. Develop a divide-and-conquer algorithm to perform a parallel merge sort of an array. Hint: After division, each process sorts its part of the array using an efficient algorithm. Then, the subarrays are merged into larger sorted subarrays. b. Analyze the communication and computation times if the number of processes is equal to the number of array elements, n. c. Repeat Part b if the number of processes is less than the number of array elements. Assume that the computation...
Create a quick and merge sort algorithm that sorts 6 9 8 12 3 1 7...
Create a quick and merge sort algorithm that sorts 6 9 8 12 3 1 7 In java please.
One way to improve quick sort is to use an insertion sort on lists that have...
One way to improve quick sort is to use an insertion sort on lists that have a small length (call it the “partition limit”). Why does this make sense?
ASAP! write a program including   binary-search and merge-sort in Python. You also need to  modify the code posted...
ASAP! write a program including   binary-search and merge-sort in Python. You also need to  modify the code posted and use your variable names and testArrays.  
Perform hypothesis tests and confidence intervals for one coefficient
Perform hypothesis tests and confidence intervals for one coefficient
How does the auditor determine the best tests to perform to achieve the audit objectives for...
How does the auditor determine the best tests to perform to achieve the audit objectives for a procedure? Please discuss and support your response with examples.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT