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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started