KRHS Internet Lesson

Teacher Name:Mr. Rung                          Date of Lesson: May/June

Course Name: C++                    Lesson Name: Chap 19 Vocab

Student Name

Password


Objective
To complete the workbook exercises.


Primary Focus
Match the columns below.

Site Links
Course Home Page

Additional Resources

Site Links


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}
BHow 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}
CTwo
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?
EEasy to implement
Why is the Shell sort generally more efficient than the bubble sort?
FIncremental
Why is the equation d = (N + 1) / 2 used to calculate the distance in a Shell sort?
GOne where the data is too large to fit in memory.
Is the bubble sort an incremental sort or a divide and conquer sort?
HTo 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}
KAllows 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
MIt compares non adjacent items.
What characteristic makes a sort appropriate for use as an external sort?
NInsertion Sort
How many temporary files does a merge sort function use during the intermediate stages of sorting?
OSo that d is rounded up and never drops below 1