Question: 1. You are the given the following data set: A[] = {39, 55, 0, 19, 241, 71, 12, 2, 58, 91} Illustrate selection sort and
1. You are the given the following data set: A[] = {39, 55, 0, 19, 241, 71, 12, 2, 58, 91} Illustrate selection sort and insertion sort, showing the data position after every step. Also compare the runtime of both algorithms. Use the tables given below for sorting. If you need additional rows, feel free to add. SELECTION SORT and INSERTION SORT
2. b) Illustrate Merge Sort to sort the following data: A[] = {D, E, I, A, S, K, O, B, G} Assume A< B < C < D < E < F < G
3.) Use the table given below to illustrate Quick Sort on the data given: [Use the partition algorithm based on last data as pivot. You must show all the steps, including the partition algorithm [ 3 8 17 2 10 6 9 8 4 7]Also compute the runtime in terms of no. of comparisons.
4. a) Illustrate BuildMaxHeap operation to build a maxheap using the following data: 35, 45, 76, 65, 37, 29, 91, 16, 80 Show each step. Use array notation as well as tree notation for illustration purpose. Array Notation b} Now use this newly formed MaxHeap and illustrate HeapSort to sort them. Compute the runtime.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
