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 12:30
An atom's diameter is about 0.1 nanometer (1×10-9m), and a human hair is about 1×10-3m. how many times greater is a human hair than an atom's diameter? sorry pushed wronf button but this is math
Answers: 3
question
Computers and Technology, 22.06.2019 22:00
Consider the following declarations (1, 2, 3, 5, 7)class bagtype{public: void set(string, double, double, double, double); void print() const; string getstyle() const; double getprice() const; void get(double, double, double, double); bagtype(); bagtype(string, double, double, double, double); private: string style: double l; double w; double h; double price; }; a.) write the definition of the number function set so that private members are set according to the parametersb.) write the definition of the member function print that prints the values of the data membersc.) write the definition of the default constructor of the class bagtype so that the private member variables are initialized to "", 0.0, 0.0, 0.0, 0.0, respectively d.) write a c++ statement that prints the value of the object newbag.e.) write a c++ statement that declares the object tempbag of type bagtype, and initialize the member variables of tempbag to "backpack", 15, 8, 20 and 49.99, respectively
Answers: 3
question
Computers and Technology, 23.06.2019 07:30
Write a program that inserts the digits of an integer into an array in originalorderfollowed by reverse order. first, promptthe user to enter a positive integer(> 0). determine the number of digits of the integer. create a dynamically allocated integer arrayof a size twice the number of digits.now insert the digits in original order which will occupy half of the array. then, insert the digits in reverse order.finally, output thedigits in thearray.use at least two functions to organize your program.
Answers: 3
question
Computers and Technology, 24.06.2019 17:40
Anewly established internet company with 40 employees needs your advice. they are looking for a collaboration tool and have narrowed their choices to gotomeeting, webex, and my web conferences. after reading the information presented in this chapter and other sources, prepare a two- page document ( double spaced) that includes two advantages and two disadvantages of each tool. which one is your final recommendation? why did you choose that tool over the other two?
Answers: 3
You know the right answer?
11 Java Multiple Choice Questions 1. Which of the following sorting algorithms is the fastest?
Questions
question
Biology, 22.10.2021 01:00
question
Mathematics, 22.10.2021 01:00