L20cs211sp07-6up - Prelim 2 Reminder Prelim 2 Prelim 2...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Graphs Lecture 20 CS211 – Spring 2007 2 Prelim 2 Reminder y Prelim 2 ± Tuesday, April 17, 7:30-9pm ± Uris Auditorium ± One week from today! ± Topics: all material up to (but not including) this week's lectures ± Does not include graphs y Exam conflicts ± Email Kelly Patwell (ASAP) y Prelim 2 Review Session ± Sunday 4/15,1:30-3:00pm ± Kimball B11 ± Individual appointments are available if you cannot attend the review session (email one TA to arrange appointment) y Old exams are available for review on the course website 3 Prelim 2 Topics y Asymptotic complexity y Searching and sorting y Basic ADTs ± stacks ± queues ± sets ± dictionaries ± priority queues y Basic data structures used to implement these ADTs ± arrays ± linked listshash tables ± BSTs ± balanced BSTs ± heaps y Know and understand the sorting algorithms ± From lecture ± From text (not Shell Sort) y Know the algorithms associated with the various data structures ± Know BST algorithms, but don’t need to memorize balanced BST algorithms y Know the runtime tradeoffs among data structures y Don’t worry about details of JCF ± But should have basic understanding of what’s available 4 Prelim 2 Topics y Language features ± inheritance ± inner classes ± anonymous inner classes ± types & subtypes ± iteration & iterators y GUI statics ± layout managers ± components ± containers y GUI dynamics ± events ± listeners ± adapters 5 Data Structure Runtime Summary y Stack [ops = put & get] ± O(1) worst-case time ² Array (but can overflow) ² Linked list ± O(1) time/operation ² Array with doubling y Queue [ops = put & get] ± O(1) worst-case time ² Array (but can overflow) ² Linked list (need to keep track of both head & last) ± O(1) time/operation ² Array with doubling y Priority Queue [ops = insert & getMin] ± O(1) worst-case time ² Bounded height PQ (only works if few priorities) ± O(log n) worst-case time ² Heap (but can overflow) ² Balanced BST ± O(log n) time/operation ² Heap (with doubling) ± O(n) worst-case time ² Unsorted linked list ² Sorted linked list (O(1) for getMin) ² Unsorted array (but can overflow) ² Sorted array (O(1) for getMin, but can overflow) 6 Data Structure Runtime Summary (Cont’d) y Set [ops = insert & remove & contains] ± O(1) worst-case time ² Bit-vector (can also do union and intersect in O(1) time) ± O(1) expected time ² Hash table (with doubling & chaining) ± O(log n) worst-case time ² Balanced BST ± O(n) worst-case time ² Linked list ² Unsorted array ² Sorted array (O(log n) for contains) y Dictionary [ops = insert(k,v) & get(k) & remove(k)] ± O(1) expected time ² Hash table (with doubling & chaining) ± O(log n) worst-case time ² Balanced BST ± O(log n) expected time ² Unbalanced BST (if data is sufficiently random) ± O(n) worst-case time ² Linked list ² Unsorted array ² Sorted array (O(log n) for contains)
Background image of page 1

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

View Full DocumentRight Arrow Icon
7 These are not Graphs 0 20 40 60 80 100 1st Qtr 2nd Qtr 3rd Qtr 4th Qtr East West North ...not the kind we mean, anyway 8 These are Graphs K 5 K 3,3 = 9 Applications of Graphs y Communication networks y
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 15

L20cs211sp07-6up - Prelim 2 Reminder Prelim 2 Prelim 2...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online