**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 ﬁnds 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

- Winter '07
- YaoyunShi
- Computational complexity theory, Natural number