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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 20:00, spetgrave069
2.)how does a graphical user interface (gui) on a touchscreen interface differ from a gui on a desktop or laptop? a.)a finger or stylus is used instead of a pointer. b.) a magic wand is used instead of a pointer. c.)users speak commands instead of using a pointer. d.)users visualize commands instead of using a pointer.
Answers: 1
image
Computers and Technology, 21.06.2019 22:00, luisanavarrogarcia
Which of the following statements correctly identifies a problem with sanitization methods? a. methods are not available to remove data ensuring that unauthorized personnel cannot retrieve data. b. even fully incinerated media can offer extractable data. c. personnel can perform sanitization steps improperly. d. stored data is physically etched into the media.
Answers: 1
image
Computers and Technology, 22.06.2019 00:00, ajwiebel3475
Which requirement is an appropriate reason for a business to use it tools
Answers: 3
image
Computers and Technology, 22.06.2019 02:00, vane1161
Aletter or menu command that starts an action when the user presses the designated letter and the alt key together is called what?
Answers: 1
You know the right answer?
11 Java Multiple Choice Questions 1. Which of the following sorting algorithms is the fastest?

Questions in other subjects: