12 Questions
| Total Attempts: 7754

Questions and Answers

- 1.Searching and sorting algorithms are best implemented with which data structure?
- A.
An array based list

- B.
A linked list

- C.
Both of the above

- D.
None of the above

- 2.What is the key used in a search algorithm?
- A.
Used in operations such as searching, sorting, inserting and deleting

- B.
Used to encrypt the data

- C.
Used in the compareTo() and equalsTo() operations

- D.
None of the above

- 3.Which search algorithm is best for a large list?
- A.
A for each loop

- B.
Sequential search

- C.
Binary search

- D.
None of the above

- 4.A binary search algorithm can be best described as what?
- A.
A instant lookup method

- B.
A divide and conquer technique

- C.
Start at the head, move through the list until found

- D.
None of the above

- 5.On average, a sequential search algorithm would make N/2 number of comparisons for a list of size N.
- A.
True

- B.
False

- 6.A function f(n) is Big-O of g(n) if there exist positive constants c and n
_{0}such that f(n) <= cg(n) for all n >= n_{0}- A.
True

- B.
False

- 7.The following best describes which algorithm? The elements are compared and swapped if the first is found to be greater than the second.
- A.
Binary search algorithm

- B.
Linear search algorithm

- C.
Bubble sorting algorithm

- D.
None of the above

- 8.The purpose of the bubble sorting algorithm is what?
- A.
To speed up the search of an item in the list

- B.
To sort the contents of the list

- C.
Both choices above

- D.
None of the above

- 9.A selection sort algorithm sorts the list by which method?
- A.
Finding the smallest element in the list and moving this to the begining of the unsorted list

- B.
Keeping a list of the smallest elements for later use when searching

- C.
None of the above

- D.
All of the above

- 10.The insertion sort algorithm improves on the selection sort method by reducing the number of comparisons.
- A.
True

- B.
False

- 11.The quick sort algorithm divides the list into two sublists, then sorts each sublists, and then combines both sublists.
- A.
True

- B.
False

- 12.The heap sort algorithm begins by converting the list into a heap, then sorting.
- A.
True

- B.
False

×

Wait!

Here's an interesting quiz for you.