Exam 12: Searching and Sorting

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which of the following algorithms has a worst case complexity of O(n log2n)?

(Multiple Choice)
4.8/5
(37)

The __________________ algorithm sorts a list of values by repetitively inserting a particular value into a subset of the list that has already been sorted.

(Multiple Choice)
4.8/5
(32)

Write out the state of the list while being sorted using the selection sort algorithm: Write out the state of the list while being sorted using the selection sort algorithm:

(Essay)
4.7/5
(31)

A linear search always requires more comparisons than a binary search.

(True/False)
4.9/5
(42)

Write a method that accepts an integer array as a parameter and sorts it using the bubble sort algorithm.

(Essay)
4.8/5
(38)

Quick sort works by separating a list into two lists, and recursively sorting the two lists using quick sort.

(True/False)
4.9/5
(33)

Explain how merge sort works.

(Essay)
4.7/5
(47)

If there are more items in a search pool, then it will typically require more comparisons to find an item.

(True/False)
4.9/5
(37)

Which of the following algorithms is most easily expressed recursively?

(Multiple Choice)
4.9/5
(32)

What is the complexity of the following code (in terms of the length of the array)? for(int i = 0; i < 5; i++) System.out.println(array[i]);

(Short Answer)
4.8/5
(41)

Which of the following algorithms has a worst-case complexity of O(n2)?

(Multiple Choice)
4.8/5
(45)

With each comparison, a binary search eliminates approximately half of the items remaining in the search pool.

(True/False)
4.7/5
(35)

Explain how quick sort works.

(Essay)
4.9/5
(32)

Every algorithm for a problem has the same efficiency.

(True/False)
4.7/5
(29)

In a binary search, _______________________________ .

(Multiple Choice)
4.9/5
(31)

Write a method that accepts an array of integers as a parameter and sorts them using the selection sort algorithm.

(Essay)
4.8/5
(42)

Bubble sort works by separating a list into two lists, recursively sorting the two lists using bubble sort, and then combining the sorted sublists into a sorted list.

(True/False)
5.0/5
(42)

The ___________________ of an algorithm shows the relationship between the size of the problem and the value we hope to optimize.

(Multiple Choice)
4.9/5
(27)

To represent constant time complexity we use O(c).

(True/False)
4.7/5
(37)

The selection sort algorithm sorts a list of values by repeatedly putting a particular value into its final, sorted position.

(True/False)
4.9/5
(41)
Showing 21 - 40 of 40
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)