{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

final-f2010

# final-f2010 - 6.006 Fall 2010 Final Exam Introduction to...

This preview shows pages 1–4. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6.006 Final Exam Name 2 Problem 1. What is Your Name? [2 points] (2 parts) (a) [1 point] Flip back to the cover page. Write your name there. (b) [1 point] Flip back to the cover page. Circle your recitation section.
6.006 Final Exam Name 3 Problem 2. Storing Partial Maxima [30 points] (1 part) 6.006 student, Mike Velli, wants to build a website where the user can input a time interval in history, and the website will return the most exciting sports event that occurred during this interval. Formally, suppose that Mike has a chronologically sorted list of n sports events with associated integer “excitement factors” e 1 , . . . , e n . You can assume for simplicity that n is a power of 2 . A user’s query will consist of a pair ( i, j ) with 1 i < j n , and the site is supposed to return max( e i , e i +1 , . . . , e j ) . Mike wishes to minimize the amount of computation per query, since there will be a lot of traffic to the website. If he precomputes and stores max( e i , . . . , e j ) for every possible input ( i, j ) , he can respond to user queries quickly, but he needs storage Ω( n 2 ) which is too much.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 13

final-f2010 - 6.006 Fall 2010 Final Exam Introduction to...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online