subject

11 Java Multiple Choice Questions 1. Which of the following sorting algorithms is the fastest?
a. insertion sort
b. selection sort
c. mergesort
e. hash sort
f. bubble sort

2. Which sorting algorithm will be slowest when run on an array that happens to already be in order?
a. insertion sort
b. selection sort
c. binary sort
d. mergesort
e. It is not possible to know which will be slowest.

3. What is the maximum number of locations that a sequential search algorithm will have to examine when looking for a particular value in an array of 300 elements? (2 points)
a. 19
b. 38
c. 75
d. 150
e. 300

4. What is the minimum number of locations that a sequential search algorithm will have to examine when looking for a particular value in an array of 300 elements? (2 points)
a. 1
b. 6
c. 7
d. 8
e. 100

5. What is the minimum number of locations that a binary search algorithm will have to examine when looking for a particular value in a sorted array of 200 elements? (2 points)
a. 1
b. 6
c. 7
d. 8
e. 200

6. What is the maximum number of locations that a binary search algorithm will have to examine when looking for a particular value in a sorted array of 200 elements? (2 points)
a. 1
b. 6
c. 7
d. 8
e. 200

7. Which of the following are quadratic sorting algorithms?

I. insertion sort
II. selection sort
III. mergesort

a. I only
b. II only
c. III only
d. I and II only
e. I, II, and III

8. Which of the following sorting algorithms is described by this text? "Start with the item at index 1, and see if it is in order compared to the item at index 0. If it is not, then swap it with the item at index 0. Then see if the item at index 2 is already in order compared to the items at the lower indexes; if it is not, then swap it with the items at lower indexes until it is in the correct order. Continue this process with all remaining indexes."
a. insertion sort
b. selection sort
c. mergesort
d. quick sort
e. binary sort

9. What is required to implement a binary search? (2 points)
a. a pivot value
b. recursion
c. sorted data
d. a hash table
e. None of the above is required.

10. An array of integers is to be sorted from smallest to biggest using an insertion sort. Assume the array originally contains the following elements:

11 17 30 8 20 25

What will it look like after the third pass through the for loop?
a. 8 11 17 20 25 30
b. 11 17 30 8 20 25
c. 11 17 30 8 25 20
d. 8 11 17 30 20 25
e. 8 11 17 20 30 25

11. An array of integers is to be sorted from smallest to biggest using a selection sort. Assume the array originally contains the following elements:

9 13 24 3 17 20

What will it look like after the third pass through the for loop?
a. 3 9 13 24 17 20
b. 3 9 13 17 24 20
c. 3 9 24 13 17 20
d. 3 13 24 9 17 20
e. 3 9 13 17 20 24

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:00
How should you set the ohms adjust control on a multitester of analog vom, for resistance measurements?
Answers: 1
question
Computers and Technology, 22.06.2019 02:20
The reset circuit used on the four 3-bit counters analyzed in this activity reset the counts to zero (000). it makes sense for the up-counters to start at zero (000), but the down-counters should start at seven (111). what would you need to change so that the 3-bit binary down counter with j/k flip-flops you just created would reset to seven (111)?
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Acloud service provider uses the internet to deliver a computing environment for developing, running, and managing software applications. which cloud service model does the provider offer? a. iaas b. caas c. maas d. paas e. saas
Answers: 1
question
Computers and Technology, 24.06.2019 09:00
Why might you chose to crest a function resume
Answers: 1
You know the right answer?
11 Java Multiple Choice Questions 1. Which of the following sorting algorithms is the fastest?
Questions
Questions on the website: 13722363