Question: Algorithm , Hello i need the correct answer with justification please Question 1 Consider an array of elements {1, 2, 3, 4, 5, 6, 7,8),


Algorithm , Hello i need the correct answer with justification please
Question 1 Consider an array of elements {1, 2, 3, 4, 5, 6, 7,8), how many comparisons does it take to sort it using Insertion Sort. a. 7 b. 8 c. 0 d. 14 e. None of the answers Question 2: Consider an array of elements {7, 6, 5, 4, 3, 2, 1}, how many comparisons does it take to sort it using Selection Sort? a. 6 b. 21 c. 7 d. 49 e. None of the answers Question 3: Consider an array of element {17, 20, 42, 9, 13, 3, 7, 24}, which two elements will be second compared in a top-down merge sort? a. {17, 20) b. {42,9} c. {13, 3} d. {7, 24 None of the answers Question 4: Consider the following array: (18,35,42,70, 75,78, 32,98). Which of the following algorithms has the minimum number of comparisons to sort this array? a.Selection sort b.Shell sort c.Merge Sort d. Insertion Sort e. None of the answers Question 5: Consider the following array: {7, 2, 10, 15, 9} and consider we want to apply Insertion sort, the first exchange that takes place is between: a. 7 and 2 b.7 and 9 c.2 and 15 d.7 and 15 e.None of the answers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
