95%(110)104 out of 110 people found this document helpful
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 been sorted in _____ order.a.recursiveb.ascendingc.staggeredd.descending2.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 variables named xand y?1
Programming Logic and Design, 8e5.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 sort6.To sort a list of 15 values using a bubble sort, the greatest number of times you would have to pass through the list making comparisons is _____.7.To completely sort a list of eight values using a bubble sort, the greatest possible number of required pair comparisons is _____.
Programming Logic and Design, 8e8.When you do not know how many items need to be sorted in a program, you can create an array that has _____.9.In a bubble sort, on each pass through the list that must be sorted, you can stop making pair comparisons _____.a.one comparison soonerb.two comparisons soonerc.one comparison laterd.two comparisons later10.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 _____.