L20cs2110fa09-6up - 1 THREADS AND CONCURRENCY Lecture 20 – CS2110 – Fall 2009 Prelim 2 Reminder 2 Prelim 2 Tuesday 17 Nov 7:30-9pm Uris

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 03/11/2009 1 THREADS AND CONCURRENCY Lecture 20 – CS2110 – Fall 2009 Prelim 2 Reminder 2 ¡ Prelim 2 ¡ Tuesday 17 Nov, 7:30-9pm ¡ Uris G01 Auditorium ¡ Ten days from today! Topics: all material up to and y Prelim 2 Review Session ¢ Currently looking into scheduling and room ¢ Considering using the Tuesday class as a review session (the day of the ¡ Topics: all material up to and including this week's lectures ¡ Includes graphs ¡ Exam conflicts ¡ Email Ken (ASAP) exam itself). Would people like this? ¢ Will announce decision on newsgroup and course web page soon y Old exams are available for review on the course website Prelim 2 Topics 3 ¡ Asymptotic complexity ¡ Searching and sorting ¡ Basic ADTs ¡ stacks ¡ queues ¡ sets y Know and understand the sorting algorithms ¢ From lecture ¢ From text (not Shell Sort) y Know the algorithms associated with the various data structures ¡ sets ¡ dictionaries ¡ priority queues ¡ Basic data structures used to implement these ADTs ¡ arrays ¡ linked lists ¡ hash tables ¡ binary search trees ¡ heaps 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 API ¢ But should have basic understanding of what’s available Prelim 2 Topics 4 ¡ Language features ¡ inheritance ¡ inner classes ¡ anonymous inner classes ¡ types & subtypes y GUI dynamics ¢ events ¢ listeners ¢ adapters ¡ iteration & iterators ¡ GUI statics ¡ layout managers ¡ components ¡ containers Data Structure Runtime Summary 5 ¡ Stack [ops = put & get] ¡ O(1) worst-case time £ Array (but can overflow) £ Linked list ¡ O(1) time/operation £ Array with doubling y Priority Queue [ops = insert & getMin] ¢ O(1) worst-case time if set of priorities is bounded ¤ One queue for each priority O(log n) wors case time £ Array with doubling ¡ 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 ¢ O(log n) worst-case time ¤ Heap (but can overflow) ¢ 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) Data Structure Runtime Summary (Cont’d) 6 ¡ 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 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 £ 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) ¢ O(log n) expected time ¤ Unbalanced BST (if data is sufficiently...
View Full Document

This note was uploaded on 03/08/2010 for the course CS 2110 taught by Professor Francis during the Spring '07 term at Cornell University (Engineering School).

Page1 / 6

L20cs2110fa09-6up - 1 THREADS AND CONCURRENCY Lecture 20 – CS2110 – Fall 2009 Prelim 2 Reminder 2 Prelim 2 Tuesday 17 Nov 7:30-9pm Uris

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

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