Ch08_Logic8e_Solutions - Programming Logic and Design, 8e...

This preview shows page 1 - 4 out of 64 pages.

Programming Logic and Design, 8eSolutions 8-Programming Logic and Design, 8th EditionChapter 8Review QuestionsREVIEW QUESTIONS1.Employee records stored in order from highest-paid to lowest-paid have beensorted in _____ order.a.recursiveb.ascendingc.staggeredd.descending1
2.Student records stored in alphabetical order by last name have been sorted in_____ order.
3.When computers sort data, they always _____.
4.Which of the following code segments correctly swaps the values of variablesnamedxandy?
Programming Logic and Design, 8eSolutions 8-y = tempx = tempb.temp = xx = yy = tempc.x = ytemp = xy = tempd.temp = xy = xx = temp5.Which type of sort compares list items in pairs, swapping any two adjacent valuesthat are out of order?a.insertion sortb.indexed sortc.bubble sortd.selection sort2
6.To sort a list of 15 values using a bubble sort, the greatest number of times youwould have to pass through the list making comparisons is _____.
7.To completely sort a list of eight values using a bubble sort, the greatest possiblenumber of required pair comparisons is _____.
Programming Logic and Design, 8eSolutions 8-b.eightc.49d.648.When you do not know how many items need to be sorted in a program, you cancreate an array that has _____.
9.In a bubble sort, on each pass through the list that must be sorted, you can stopmaking pair comparisons _____.a.one comparison soonerb.two comparisons soonerc.one comparison laterd.two comparisons later
10.When performing a bubble sort on a list of 10 values, you can stop making passesthrough the list of values as soon as _____ on a single pass through the list.
11.The bubble sort is _____.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 64 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture