hw6 - of running your implementation(This means that...

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

View Full Document Right Arrow Icon
Homework 6 CSE 450/598 Spring 2010 Arizona State University Due: Thursday March 25 before 10:30 1. (6.3) 2. (6.4) 3. (6.6) 4. (6.10) 5. [Implementation Question] Read Question 6.7 and implement an algorithm for the prob- lem described there (and in the Solved Exercise 2 of Chapter 5). Implement either the algo- rithm described in the Solved Exercise with running time O ( n log n ) , or (for extra credit) the one alluded to in Question 6.7 with running time O ( n ) (if you do this, you should also explain the algorithm itself). Generate instances of large enough size to examine ex- perimentally the performance of your implementation and plot graphs to show the results
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: of running your implementation. (This means that you’ll hand in a written answer to this queston as well as the usual implementation.) The function to call in order to run your algorithm should be called plan , and the input for it should be a list of stock prices describing [ p ( 1 ) , p ( 2 ) , . . . , p ( n )] , for example [ 45, 42, 50, 48, 51, 44 ] . You may assume the prices are integers. Your function should return a pair a , b with the interpretation “buy on day a , sell on day b ”. 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online