60 likes | 93 Views
Review for Exam 1. Topics covered: Asymptotic analysis Lists and list implementations Stacks and queues General trees, binary trees BST For each of these data structures Basic idea of data structure and operations Be able to work out small example problems Advantages and limitations
E N D
Review for Exam 1 • Topics covered: • Asymptotic analysis • Lists and list implementations • Stacks and queues • General trees, binary trees • BST • For each of these data structures • Basic idea of data structure and operations • Be able to work out small example problems • Advantages and limitations • Asymptotic time performance of their operations • Comparison between different implementations
Asymptotic analysis • Best/Worst/Average performance (time and space) • Big-O notation and properties • Definition (constants c and n0) • Lower order terms, constant coefficients • Sum rule, product rule (be careful) • Proofs • Growth rates of commonly used functions • Constant/logarithm/polynomial/exponential • L’Hospital’s rule • Amortized analysis • Average behavior for a long sequence of operations
Lists • List ADT. • Basic operations and their time performance (implemen-tation dependent) • List iterators. • List implementation • Array • Linked list • Stacks and queues • ADT and operations (and their time performance) • Implementation: Adaptor • How this design pattern works • Pros and cons
General tree • Definition • Internal and external nodes • Height and depth, path length • Tree storage methods and their nodes • Binary trees • Binary tree ADT • Definitions of Full, complete and perfect binary trees and their properties • Recursive definition of binary tree leads to • Recursive implementation of methods • Induction proof for properties • 4 different orders of tree traversals
BST • Definition • Basic operations and their implementations • Find/contains, • findMin, • findMax • insert, • remove, • recursive implementations • Time performance of these operations • BST iterators • Problems with unbalanced BST (degeneration)
Types of questions: Similar to those of the review questions on the class website (under Exams) • Definitions • Short questions • Coding (some may require using operations already defined in the class, mostly in pseudo code) • Applying operations to specific example problems • Proofs