Question: Answer the multiple choice. Please. Question 1 True or false: If an array is already sorted, Linear Search / Sequential Search is more efficient than

Answer the multiple choice. Please.

Question 1

True or false: If an array is already sorted, Linear Search / Sequential Search is more efficient than Binary Search.

Question 1 options:

True
False

Question 2

True or False: elements in an array need to be sorted for Linear Search to work.

Question 2 options:

True
False

Question 3

Which of the following are false?

Question 3 options:

Binary search works with a randomly ordered array.

Binary search works with any data type which can be ordered from least to greatest. (or greatest to least)

Binary search eliminates half the remain elements each move.

Binary search is faster than linear search most of the time

Question 4

We are searching for an int key in a sorted int array that has n elements. Under what circumstances will Linear Search / Sequential Search be more efficient than Binary Search?

Question 4 options:

key is the last element in the array

key is in the middle of the array

n is very large

key is the first element in the array

Question 5

What is the largest number of comparisons needed to perform a binary search on an array with 42 elements?

Question 5 options:

5

6

42

4

2

Question 6

What is the largest number of comparisons needed to perform a linear search on an array with 42 elements?

Question 6 options:

1

42

5

4

6

Question 7

True or false: Bubble sort is a recursive sort.

Question 7 options:

True
False

Question 8

True or false: merge sort is a recursive sort.

Question 8 options:

True
False

Question 9

What sort is pictured here?

Answer the multiple choice. Please. Question 1 True or false: If an

Question 9 options:

bubble sort

selection sort

insertion sort

merge sort

none of the above

Question 10

What sort is pictured here?

array is already sorted, Linear Search / Sequential Search is more efficient

Question 10 options:

bubble sort

selection sort

insertion sort

merge sort

none of the above

Question 11

What sort is pictured here?

than Binary Search. Question 1 options: True False Question 2 True or

Question 11 options:

bubble sort

selection sort

insertion sort

merge sort

none of the above

Question 12

True or false: the base case in recursive functions is optional.

Question 12 options:

True
False

Save

Question 13

True or false: there can only be one base case in any recursive function.

Question 13 options:

True
False

Question 14

Consider the following recursive function:

public int mystery2(int n) { if(n == 0) { return mystery2(10); } else { return 2 * mystery(n - 1); } }

How many times will the function mystery be called if we call mystery(5) (be sure to include the first call mystery(5))

Question 14 options:

4

5

6

7

The recursion will go on forever because there is no base case

Question 15

Consider the following recursive function:

public int mystery2(int n) { if(n == 0) { return 2; } else { return 2 * mystery(n - 1); } }

How many times will the function mystery be called if we call mystery(5) (be sure to include the first call mystery(5))

Question 15 options:

4

5

6

7

The recursion will go on forever because there is no base case.

OP WOON

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!