# lec03 - 6.006 Introduction to AlgorithmsLecture 3 Prof...

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

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

View Full Document

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

View Full Document

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.

Unformatted text preview: 6.006- Introduction to AlgorithmsLecture 3 Prof. Piotr IndykOverview •Runway reservation system: – Definition – How to solve with lists •Binary Search Trees – Operations Readings: CLRS 10, 12.1-3 10 12 5 1 6 7 http://izismile.com/tags/Gibraltar/ Runway reservation system •Problem definition: – Single (busy) runway – Reservations for landings • maintain a set of future landing times • a new request to land at time t • add tto the set if no other landings are scheduled within < 3 minutes from t • when a plane lands, removed from the set Runway reservation system •Example – R = (41, 46, 49.1, 56) – requests for time: • 44 => reject (46 in R) • 53 => ok • 20 => not allowed (already past) •Ideas for efficient implementation ? 37 (now) 41 46 49.1 56 time (mins) Some options: •Keep Ras an unsorted list – Bad: takes linear time to search for collisions – Good: can insert tin O(1) time •Keep Ras a sorted array (resort after each insertion) – Bad:...
View Full Document

{[ snackBarMessage ]}

### Page1 / 15

lec03 - 6.006 Introduction to AlgorithmsLecture 3 Prof...

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

View Full Document
Ask a homework question - tutors are online