{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

01 - Maximum Contiguous Subarray - Divide and Conquer

01 - Maximum Contiguous Subarray - Divide and Conquer - 4-3...

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

View Full Document Right Arrow Icon
COMP 271: Design and Analysis of Algorithms Fall 2007 Tutorial 1 Answer ONE of the following two questions in the first 20 minutes. The TA will discuss the answers in the remaining 30 minutes. Question 1 : Follow the example of Lecture 2 and illustrate the MCS algo- rithm with the following input:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 4-3 5-2-1 2 6-2 Question 2 : Suppose you are given an increasing sequence of n distinct in-tegers in an array A [1 ..n ]. Design an efficient algorithm to determine whether there exists an index i such that A [ i ] = i . Justify the correctness of your algorithm and analyze its running time. 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online