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, 22.06.2019 02:00
Alocal reaction will occur at the site of the exposure such as irritation or damage to the skin eye or local reaction will occur at the site of the exposure such as irritation or damage to the skin ireland lounges
Answers: 3
question
Computers and Technology, 22.06.2019 03:30
Some of your friends have gotten into the burgeoning field of time-series data mining, in which one looks for patterns in sequences of events that occur over time. purchases at stock exchanges--what’s being bought-- are one source of data with a natural ordering in time. given a long sequence s of such events, your friends want an efficient way to detect certain "patterns" in them--for example, they may want to know if the four events buy yahoo, buy ebay, buy yahoo, buy oracle occur in this sequence s, in order but not necessarily consecutively. they begin with a collection of possible events (e.g., the possible’ transactions) and a sequence s of n of these events. a given event may occur multiple times in s (e.g., yahoo stock may be bought many times in a single sequence s). we will say that a sequence s’ is a subsequence of s if there is a way to delete certain of the events from s so that the remaining events, in order, are equal to the sequence s’. so, for example, the sequence of four events above is a subsequence of the sequence buy amazon, buy yahoo, buy ebay, buy yahoo, buy yahoo, buy oracle their goal is to be able to dream up short sequences and quickly detect whether they are subsequences of s. so this is the problem they pose to you: give an algorithm that takes two sequences of even~s--s’ of length m and s of length n, each possibly containing an event more than once--and decides in time o(m n) whether s’ is a subsequence of s
Answers: 2
question
Computers and Technology, 22.06.2019 07:00
Idon understand these and need some ! ?
Answers: 2
question
Computers and Technology, 22.06.2019 10:40
When running anti-virus software , what could be a reason where recipitent is not guaranteed that data being streamed will not get interrupted?
Answers: 1
You know the right answer?
11 Java Multiple Choice Questions 1. Which of the following sorting algorithms is the fastest?
Questions
question
Mathematics, 14.09.2021 09:10
question
Mathematics, 14.09.2021 09:10
question
English, 14.09.2021 09:10
Questions on the website: 13722363