| Identify one common use for a sorting algorithm.
| A | (55)(87) (100)(23) (34)(12) (22)(2)
(55, 87) (23, 100) (12, 34) (2, 22)
(23 , 55 , 87 , 100) (2 , 12, 22 , 34)
(2 , 12 , 22 , 23 , 34, 55 , 87 , 100)
|
| Given the following array, indicate the order of the array after pass two of a selection sort in descending order.
{34,69,122,2,15,99,22}
| B | How much data is there?
How out of sort is it?
Where is it stored?
How often will it be sorted?
|
| Given the following array, show each step of an insertion sort in descending order. Show both sublists. {45, 100, 6}
| C | Two
|
| What is one disadvantage of the selection sort?
| D | () (45) (100,45) (100,45,6)
(45,100,6) (100,6) (6) ()
|
| What sorting algorithm can be very efficient with small lists and lists which are partially or fully sorted to begin with?
| E | Easy to implement
|
| Why is the Shell sort generally more efficient than the bubble sort?
| F | Incremental
|
| Why is the equation d = (N + 1) / 2 used to calculate the distance in a Shell sort?
| G | One where the data is too large to fit in memory.
|
| Is the bubble sort an incremental sort or a divide and conquer sort?
| H | To create a phone book.
|
| Given the following array, show each step of a bubble sort in ascending order.
{96, 10,45}
| I | (54,89,23,69,65,100)
(54,89,23) (69,65,100)
(54)(89,23)(69)(65,100)
|
| In the Shell sort algorithm, what is the purpose of the flag variable?
| J | (34,69,122,99,22,15,2)
|
| Show the partitions of the following array after two passes of a quicksort.
{54,89,23,69,65,100}
| K | Allows the sort to end early if the list is completely sorted.
|
| In the space below, draw a diagram similar to Figure 19-7 in the textbook that illustrates an ascending merge sort of the following list.
{55, 87, 100, 23,34, 12, 22, 2}
| L | (96,10,45) (10,96,45) (10,45,96)
|
| List four factors that should be considered when choosing an appropriate sorting algorithm
| M | It compares non adjacent items.
|
| What characteristic makes a sort appropriate for use as an external sort?
| N | Insertion Sort
|
| How many temporary files does a merge sort function use during the intermediate stages of sorting?
| O | So that d is rounded up and never drops below 1
|