Question: It is mandatory to mention the question number when writing your answers. 11. Consider array1 as: int [] array1 = {13, 20, 1, 56}; How
It is mandatory to mention the question number when writing your answers.
11. Consider array1 as: int [] array1 = {13, 20, 1, 56};
How many comparisons are needed by linear search to find 13? (1 mark)
How many comparisons are needed by linear search to find 20? (1 mark)
It is mandatory to mention the question number when writing your answers.
12. Consider array2 as: int [] array2 = {6, 9, 14, 22, 31, 40};
How many comparisons are needed by binary search to find 22? (1 mark)
How many comparisons are needed by binary search to find 31? (1 mark)
How many comparisons are needed by binary search to find 40? (1 mark)
Arrange array3 in ascending order using Selection sort. Show all steps. (5 marks) int [] array3 = {3, 5, 7, 1, 2};
Arrange array4 in ascending order using Insertion sort. Show all steps. (5 marks) int []array4 = {7, 4, 3, 2, 8};
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
