This preview shows page 1. Sign up to view the full content.
Unformatted text preview: the length of the longest path from this node to a leaf. ) 5 Suppose the changes of stock price of GOOGLE in the past n days are stored in array A[1. . n ]. We would like to know in which period, the accumulative increase is the largest. For example, in the past 7 days, if the changes are +3, 6, +5, +2, 3, +4, 4, then, the largest increase is from day 3 to day 6. The accumulative increase is 5+23+4 = 8. Please design a divide and conquer algorithm that finds the period such that the accumulative increase is the largest. That is to find two indices i and j (1 i j n ) such that = j i k k A ] [ is the largest. Analyze the complexity of your algorithm. 1...
View
Full
Document
This note was uploaded on 04/12/2008 for the course CS 592 taught by Professor Shen during the Winter '05 term at University of MissouriKansas City .
 Winter '05
 Shen
 Algorithms

Click to edit the document details