This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full 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:309pm Â¡ 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) worstcase time Â£ Array (but can overflow) Â£ Linked list Â¡ O(1) time/operation Â£ Array with doubling y Priority Queue [ops = insert & getMin] Â¢ O(1) worstcase 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) worstcase 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) worstcase time Â¤ Heap (but can overflow) Â¢ O(log n) time/operation Â¤ Heap (with doubling) Â¢ O(n) worstcase 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) worstcase time Â£ Bitvector (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) worstcase time Â¤ Balanced BST Â£ Hash table (with doubling & chaining) Â¡ O(log n) worstcase time Â£ Balanced BST Â¡ O(n) worstcase 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).
 Spring '07
 FRANCIS
 Data Structures

Click to edit the document details