Question: Java 1) Suppose int[] intArray = {2, 4, 5, 16, 28, 32, 40}. What is the order of elements identified for comparison when the binary

Java

1) Suppose int[] intArray = {2, 4, 5, 16, 28, 32, 40}. What is the order of elements identified for comparison when the binary search algorithm attempts to find the value 5 in intArray?

a) 2, 4, 5
b) 16, 4, 5
c) 2, 5
d) 16, 5

2)

Suppose int[] intArray = {2, 4, 5, 16, 28, 32, 40}. What is the order of elements identified for comparison when the linear search algorithm attempts to find the value 5 in intArray?

a) 2, 5
b) 16, 4, 5
c) 16, 5
d) 2, 4, 5

3) Check the statements about Big O notation that are true.

a) Big O notation describes how long it will take a programmer to code an algorithm
b) Big O notation describes an algorithm's efficiency in terms of the work required to solve a problem
c) In Big O notation, constants are ignored
d) Big O notation indicates the number of seconds an algorithm takes to run

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!