Exam 10: Sorting Algorithms

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

If the list is stored in a linked list, we can traverse the list in only one direction starting at the first node because the links are only in one direction.

(True/False)
4.8/5
(33)

In a heap, the ____ element of the list is always the first element of the list.

(Multiple Choice)
4.8/5
(29)

In the average case of quicksort, the number of key comparisons is ____.

(Multiple Choice)
4.9/5
(37)

Assuming a priority queue is implemented as a stack, to remove the first element of the priority queue, we copy the last element of the list into the first array position, reduce the length of the list by 1, and restore the heap in the list.

(True/False)
4.7/5
(36)

Mergesort and quicksort are similar in how they partition the list.

(True/False)
4.8/5
(34)

The modified insertion sort introduced in 1959 by D. E. Shell is known as the diminishing return sort.

(True/False)
4.9/5
(43)

____ sort sorts the list by moving each element to its proper place.

(Multiple Choice)
4.9/5
(31)

The____ for array-based lists is of order O(n log2n) even in the worst case, therefore overcoming the worst case of the quicksort.

(Multiple Choice)
4.9/5
(38)

A binary search is very fast for array-based lists.

(True/False)
4.8/5
(37)

In ____, the elements of the list are viewed as sublists at a particular distance.

(Multiple Choice)
4.8/5
(33)

In heapsort, only the elements at position 2k + 1 are accessed frequently.

(True/False)
4.9/5
(46)

In C++, the array index starts at 0.

(True/False)
4.7/5
(32)

If the list is stored in an array, we can traverse the list in either direction using an ____.

(Multiple Choice)
4.7/5
(34)

Sorted sublists are merged into a sorted list by comparing the elements of the sublists, and then adjusting the references of the nodes with the smaller info.

(True/False)
4.9/5
(34)

In mergesort, most of the sorting work is done in ____.

(Multiple Choice)
4.9/5
(33)

After inserting the new element in the heap, the list might no longer be a heap.

(True/False)
4.9/5
(35)

The first step in the heapsort of this chapter is to convert the list into a heap, called ____.

(Multiple Choice)
4.8/5
(27)

With selection sort, we can keep track of the unsorted portion of the list and repeat the steps involved with sorting with the help of a ____ loop.

(Multiple Choice)
4.9/5
(39)

When inserting an element in the priority queue, restoring the heap might result in moving the new entry to the root node.

(True/False)
4.8/5
(43)

A(n) ____ finds the location of the smallest element in the unsorted portion of the list and moves it to the top of the unsorted portion of the list.

(Multiple Choice)
4.9/5
(35)
Showing 21 - 40 of 47
close modal

Filters

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