203w07hw7 - Problem A7.2(C Let A be a n × n integer matrix...

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

View Full Document Right Arrow Icon
EECS 203, Discrete Mathematics Winter 2007, University of Michigan, Ann Arbor Problem Set 7 Problems from the Textbook 3.1 34[E], 56[E] 3.2 12[E], 20[E], 18[M] 3.3 10[E] (you can use a calculator, express your result in terms of years and days (1 year = 365 days) if it’s more than a day) * Additional Problems Required for All Students Problem A7.1 (M). Describe an algorithm that finds the k ’th largest number from an input of n num- bers. Prove that your algorithm is correct. State and prove the worse-case number of comparisons of your algorithm. You will get the full score for a correct answer those complexity (in the number of comparisons) is O ( n log k ). A 20% extra credit (or penalty) applies if the complexity of your algorithm is better (or worse).
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Problem A7.2 (C). Let A be a n × n integer matrix, and is sorted in the non-increasing order within each row and each column. Let x be an integer. Describe an algorithm that makes O ( n ) comparisons to decide if x appears in A . Prove the correctness and the time complexity of your algorithm. * Extra Credit Problem A7.3. Let A be an array of n integers A [0], A [1], ··· , A [ n-1]. Describe a O ( n ) algorithm that finds max { A [ i ] + A [ i + 1] + ··· + A [ j ] : 0 ≤ i ≤ j ≤ n-1 } . Prove the correctness and the time complexity of your algorithm. 1...
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