Question: Given sequence 3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, sort the sequence using the following algorithms, and illustrate the details of
Given sequence 3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, sort the sequence using the following algorithms, and illustrate the details of the execution of the algorithms:
a. (5 marks) merge-sort algorithm.
b. (8 marks) quick-sort algorithm. Choose a partitioning strategy you like to pick a pivot element from the sequence. Analyze how different portioning strategies may impact on the performance of the sorting algorithm.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
