COM
Ch08_Logic8e_Solutions

Ch08_Logic8e_Solutions - Programming Logic and Design 8e...

Info icon This preview shows pages 1–5. Sign up to view the full content.

Programming Logic and Design, 8e Solutions 8- Programming Logic and Design, 8th Edition Chapter 8 Review Questions REVIEW QUESTIONS 1. Employee records stored in order from highest-paid to lowest-paid have been sorted in _____ order. a. recursive b. ascending c. staggered d. descending 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 variables named x and y ? 1
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Programming Logic and Design, 8e Solutions 8- y = temp x = temp x = y y = temp temp = x y = temp y = x x = temp 5. Which type of sort compares list items in pairs, swapping any two adjacent values that are out of order? a. insertion sort b. indexed sort c. bubble sort d. selection sort 6. 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 _____. 2
Image of page 2
Programming Logic and Design, 8e Solutions 8- 8. When you do not know how many items need to be sorted in a program, you can create an array that has _____. the program. 9. In a bubble sort, on each pass through the list that must be sorted, you can stop making pair comparisons _____. a. one comparison sooner b. two comparisons sooner c. one comparison later d. two comparisons later 10. When performing a bubble sort on a list of 10 values, you can stop making passes through the list of values as soon as _____ on a single pass through the list. 11. The bubble sort is _____. 3
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Programming Logic and Design, 8e Solutions 8-
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern