1What are the three things that sorting routines are evaluated on
[A] speed
[B] memory overhead
[C] data sorted
2The steps for the Heap Sort algorithm are as follows:
1. Put the items to be sorted in a [A] binary tree
2. Build the initial [B]
3. Repeatedly remove the [C] and [D]
[A] left balance
[B] heap
[C] root
[D] reheap or rebuild
3Which sort has the highest memory overhead?
- Binary Tree Sort
- Heap Sort
- Merge Sort
- Quick Sort
4Which sort recursively combines sorted sub-arrays?
- Merge Sort
- Binary Sort
- Quick Sort
- Heap Sort
5Which sort recursively breaks the data set into two pieces based on a pivot value?
- Quick Sort
- Merge Sort
- Heap Sort
- Bubble Sort
6Which sort requires a tree to be built which has a particular shape and order?
- Heap Sort
- Bubble Sort
- Merge Sort
- Quick Sort
7Which sort is very simple to code and is the best for almost sorted data?
- Bubble Sort
- Quick Sort
- Merge Sort
- Heap Sort
8When performing swaps within a sort method
- Shallow copies are preferred over deep copies
- Deep copies are preferred over shallow copies
- There is not much difference in swapping deep or shallow copies
9What is unique about the Binary Tree sort over the other sorts discussed in this chapter?
- It doesn't perform swaps
- It performs swaps
10What is the theoretical minimum Big-Oh for comparison-based algorithms.
11When creating a priority queue where the priorities are 1 - 4 where 1 is the highest priority:
1. This would be implemented with a (min, max) [A] heap
2. To insert to priority queue, place the new item to be sorted at the [B] of the array
3. The parent of an object at index 12 would be at index [C]
[A] min
[B] end
[C] 5
12The algorithm for the Binary Search Sort requires that all items to be sorted be inserted into a Binary Search Tree. Then use the [A] traversal for ascending order and the [B] traversal for descending order.
[A] LNR
[B] RNL
13The steps for the Merge Sort algorithm
1. Break the array into [A] sub-arrays
2. [B] each subarray
3. [C] the sorted subarrays together
4. Base case of the recursive algorithm is when the size of the sub-array is [D]
[A] 2
[B] sort
[C] merge
[D] 1
14The speed of a sorting algorithm depends upon the number of [A] and the number of [B]
[A] comparisons
[B] swaps
15Objects in an array to be sorted must be of the same class.
16Sorting a chain of linked nodes is usually easier than sorting an array
17Selection sort is efficient for large arrays.
18Implementing the insertion sort for a linked chain of nodes is generally difficult.
19The iterative merge sort algorithm is much simpler than the recursive algorithm
20In quick sort, the partition places the pivot in the position that it will occupy in the final sorted array.
21The radix sort restricts the data that it sorts on.
22Divide and conquer algorithms can only be written recursively.