Discrete Mathematics with Graph Theory (3rd Edition) 234

Discrete Mathematics with Graph Theory (3rd Edition) 234 -...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
232 9. .c 1 .c 2 1,4,9,12 4,9,12 4,9,12 4,9,12 9,12 9,12 9,12 9,12 .c 3 2,4,7,7,9,11 2,4,7,7,9,11 4,7,7,9,11 7,7,9,11 7,7,9,11 7,9,11 9,11 11 11 12 1 1,2 1,2,4 1,2,4,4 1,2,4,4,7 1,2,4,4,7,7 1,2,4,4,7,7,9 1,2,4,4,7,7,9,9 1,2,4,4,7,7,9,9,11,12 The algorithm required nine comparisons. to. (a) [BB] The lists 1 and 2,3,4 can be merged with one comparison . .cl.c2 .c3 1 2,3,4 1,2,3,4 (b) [BB] The lists 5 and 2,3,4 can be merged with three comparisons . .c 1 .c 2 .c 3 5 2,3,4
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 5 3,4 5 4 2 2,3 2,3,4,5 Solutions to Exercises (c) [BB] The lists 1,3,5 and 2,4,6 can be merged with 3 + 3 - 1 = 5 comparisons . .c 1 .c 2 .c 3 1,3,5 3,5 3,5 5 5 2,4,6 2,4,6 1 4,6 1,2 4,6 6 1,2,3 1,2,3,4 1,2,3,4,5,6 11. Two such lists are 1,2,3,4 and 5, and here's why . .c 1 .c 2 .c 3 1,2,3,4 5 2,3,4 5 3,4 5 4 5 1 1,2 1,2,3 1,2,3,4,5 12. To merge two given sorted lists of lengths s and t, into a single sorted list of length s + t, proceed as follows....
View Full 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