Page 1 of 1

7. Suppose we are sorting an array of 10 integers using quicksort, and we have just finished the first partitioning with

Posted: Wed Apr 27, 2022 3:49 pm
by answerhappygod
7 Suppose We Are Sorting An Array Of 10 Integers Using Quicksort And We Have Just Finished The First Partitioning With 1
7 Suppose We Are Sorting An Array Of 10 Integers Using Quicksort And We Have Just Finished The First Partitioning With 1 (38.23 KiB) Viewed 43 times
7. Suppose we are sorting an array of 10 integers using quicksort, and we have just finished the first partitioning with the array looking like this: 2, 5, 3, 7, 8, 11, 10, 15, 60,20 Which of the following is true? a) The pivot could be either the 7 or the 8. b) The pivot is 11 c) The pivot is 10 d) The pivot is 3 c) The pivot is 8 8. Suppose that we apply selection sort algorithm to the given unsorted array below to sort it in increasing order. 5, 1, 4, 8, 9, 15, 6,2 After the first iteration (phase) of the algorithm, we have the array below: 1,5, 4, 8, 9, 15, 6,2 Which one is the array after the third iteration (phase) of the algorithm? a) 1,2,4,8, 9, 15, 6,5 b) 1,2,4,5,9,15,6,8 c) 1,2,4,9, 5, 15, 6, 8 d) 1, 2, 4, 8, 9,5,6, 15 e) 1, 2, 4, 5, 6, 8, 9, 15