Course Review. Cpt S 223 Fall 2009

Similar documents
Course Review. Cpt S 223 Fall 2010

Cpt S 223 Fall Cpt S 223. School of EECS, WSU

Course Review for Finals. Cpt S 223 Fall 2008

Course Review for. Cpt S 223 Fall Cpt S 223. School of EECS, WSU

Cpt S 223 Course Overview. Cpt S 223, Fall 2007 Copyright: Washington State University

The questions will be short answer, similar to the problems you have done on the homework

Data Structures Question Bank Multiple Choice

Course goals. exposure to another language. knowledge of specific data structures. impact of DS design & implementation on program performance

CS301 - Data Structures Glossary By

ECE250: Algorithms and Data Structures Midterm Review

CSE 332 Autumn 2013: Midterm Exam (closed book, closed notes, no calculators)

CSE 332 Winter 2015: Midterm Exam (closed book, closed notes, no calculators)

AP Computer Science 4325

Binary Trees, Binary Search Trees

logn D. Θ C. Θ n 2 ( ) ( ) f n B. nlogn Ο n2 n 2 D. Ο & % ( C. Θ # ( D. Θ n ( ) Ω f ( n)

CSE373: Data Structures & Algorithms Lecture 28: Final review and class wrap-up. Nicki Dell Spring 2014

Data Structures and Algorithm Analysis in C++

CSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators)

Analysis of Algorithms

Recall: Properties of B-Trees

CSCI-1200 Data Structures Fall 2018 Lecture 23 Priority Queues II

Priority Queues Heaps Heapsort

COSC 2007 Data Structures II Final Exam. Part 1: multiple choice (1 mark each, total 30 marks, circle the correct answer)

D. Θ nlogn ( ) D. Ο. ). Which of the following is not necessarily true? . Which of the following cannot be shown as an improvement? D.

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

CSE 332 Spring 2014: Midterm Exam (closed book, closed notes, no calculators)

Trees. (Trees) Data Structures and Programming Spring / 28

CS251-SE1. Midterm 2. Tuesday 11/1 8:00pm 9:00pm. There are 16 multiple-choice questions and 6 essay questions.

( ) D. Θ ( ) ( ) Ο f ( n) ( ) Ω. C. T n C. Θ. B. n logn Ο

) $ f ( n) " %( g( n)

Advanced Set Representation Methods

( ) ( ) C. " 1 n. ( ) $ f n. ( ) B. " log( n! ) ( ) and that you already know ( ) ( ) " % g( n) ( ) " #&

Midterm solutions. n f 3 (n) = 3

APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY THIRD SEMESTER B.TECH DEGREE EXAMINATION, JULY 2017 CS205: DATA STRUCTURES (CS, IT)

End-Term Examination Second Semester [MCA] MAY-JUNE 2006

UNIT III BALANCED SEARCH TREES AND INDEXING

Summer Final Exam Review Session August 5, 2009

CSE 373 APRIL 17 TH TREE BALANCE AND AVL

R13. II B. Tech I Semester Supplementary Examinations, May/June DATA STRUCTURES (Com. to ECE, CSE, EIE, IT, ECC)

INSTITUTE OF AERONAUTICAL ENGINEERING

Lecture 6: Analysis of Algorithms (CS )

Tree: non-recursive definition. Trees, Binary Search Trees, and Heaps. Tree: recursive definition. Tree: example.

CMSC 341 Priority Queues & Heaps. Based on slides from previous iterations of this course

! Tree: set of nodes and directed edges. ! Parent: source node of directed edge. ! Child: terminal node of directed edge

Lec 17 April 8. Topics: binary Trees expression trees. (Chapter 5 of text)

University of Waterloo Department of Electrical and Computer Engineering ECE250 Algorithms and Data Structures Fall 2014

CSci 231 Final Review

Basic Data Structures (Version 7) Name:

Direct Addressing Hash table: Collision resolution how handle collisions Hash Functions:

Cpt S 122 Data Structures. Course Review Midterm Exam # 1

Topics. Trees Vojislav Kecman. Which graphs are trees? Terminology. Terminology Trees as Models Some Tree Theorems Applications of Trees CMSC 302

COMP : Trees. COMP20012 Trees 219

n 2 ( ) ( ) Ο f ( n) ( ) Ω B. n logn Ο

E.G.S. PILLAY ENGINEERING COLLEGE (An Autonomous Institution, Affiliated to Anna University, Chennai) Nagore Post, Nagapattinam , Tamilnadu.

Data Structure. IBPS SO (IT- Officer) Exam 2017

COMP251: Algorithms and Data Structures. Jérôme Waldispühl School of Computer Science McGill University

9/29/2016. Chapter 4 Trees. Introduction. Terminology. Terminology. Terminology. Terminology

Lecture: Analysis of Algorithms (CS )

Table of Contents. Chapter 1: Introduction to Data Structures... 1

Data Structure. A way to store and organize data in order to support efficient insertions, queries, searches, updates, and deletions.

n 2 ( ) ( ) + n is in Θ n logn

Introduction. for large input, even access time may be prohibitive we need data structures that exhibit times closer to O(log N) binary search tree

Uses for Trees About Trees Binary Trees. Trees. Seth Long. January 31, 2010

1) What is the primary purpose of template functions? 2) Suppose bag is a template class, what is the syntax for declaring a bag b of integers?

( ) n 3. n 2 ( ) D. Ο

Department of Computer Science and Technology

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

Trees. CSE 373 Data Structures

( ). Which of ( ) ( ) " #& ( ) " # g( n) ( ) " # f ( n) Test 1

Assume you are given a Simple Linked List (i.e. not a doubly linked list) containing an even number of elements. For example L = [A B C D E F].

Computational Optimization ISE 407. Lecture 16. Dr. Ted Ralphs

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid

Lecture Summary CSC 263H. August 5, 2016

( ) + n. ( ) = n "1) + n. ( ) = T n 2. ( ) = 2T n 2. ( ) = T( n 2 ) +1

Analysis of Algorithms

CSCE 210/2201 Data Structures and Algorithms. Prof. Amr Goneid. Fall 2018

CS350: Data Structures Heaps and Priority Queues

CS 8391 DATA STRUCTURES

Recursive Data Structures and Grammars

Test 1 Last 4 Digits of Mav ID # Multiple Choice. Write your answer to the LEFT of each problem. 2 points each t 1

CSE 373 Autumn 2010: Midterm #1 (closed book, closed notes, NO calculators allowed)

CS8391-DATA STRUCTURES QUESTION BANK UNIT I

CSE 332, Spring 2010, Midterm Examination 30 April 2010

& ( D. " mnp ' ( ) n 3. n 2. ( ) C. " n

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

CS61BL. Lecture 3: Asymptotic Analysis Trees & Tree Traversals Stacks and Queues Binary Search Trees (and other trees)

Programming II (CS300)

DATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305

Data Structures. Outline. Introduction Linked Lists Stacks Queues Trees Deitel & Associates, Inc. All rights reserved.

University of Illinois at Urbana-Champaign Department of Computer Science. Final Examination

21# 33# 90# 91# 34# # 39# # # 31# 98# 0# 1# 2# 3# 4# 5# 6# 7# 8# 9# 10# #

Binary Trees

CS 240 Fall Mike Lam, Professor. Priority Queues and Heaps

CS8391-DATA STRUCTURES

Final Examination CSE 100 UCSD (Practice)

CH 8. HEAPS AND PRIORITY QUEUES

BRONX COMMUNITY COLLEGE of the City University of New York DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE. Sample Final Exam

CH. 8 PRIORITY QUEUES AND HEAPS

CMSC 341 Lecture 14: Priority Queues, Heaps

! Tree: set of nodes and directed edges. ! Parent: source node of directed edge. ! Child: terminal node of directed edge

Transcription:

Course Review Cpt S 223 Fall 2009 1

Final Exam When: Tuesday (12/15) 8-10am Where: in class Closed book, closed notes Comprehensive Material for preparation: Lecture slides & class notes Homeworks & program assignments Weiss book 2

Course Overview Proving techniques and recursion Asymptotic notation & analysis Data structures & purpose: Maintaining a set of elements FIFO, LIFO Searching (ordered) Prioritizing Disjoint sets Searching (unordered), string=>int mapping Network, interactions Linked list, array Queue, stack BST, AVL tree, B-tree Binary heap, binomial heap Union-find Hash table Graph 3

Course Review Program design Tradeoffs: space, time efficiency, design simplicity Runtime measurement, plotting and explanation STL: vector, list, queue, stack set, map, multiset, multimap priority_queue hash_set, hash_map 4

User Developmental Cycle Problem specification (tools) High-level design Garage Tools (data structures) input Experimentation - Simulations - real data - benchmarking (testing) refine Algorithm design (methods) - optimize costs - maximize performance - space-time tradeoffs - design simplicity Analysis 5

Objectives 1. Introduce new & advanced data structures 2. Introduce algorithmic design and analysis 3. Solve problems using different data structures and design techniques, and compare their performance and tradeoffs 4. Implement algorithms and data structures in C++ 6

Math Review Series: Definitions, manipulations, arithmetic and geometric series closed form Proofs: Know definition, components, and how to use the following Proof by induction Proof by counterexample Proof by contradiction Recursion Know definition and rules Analyze running time of recursive algorithm Tail recursion 7

Algorithmic Analysis Why analyze an algorithm? Line-by-line analysis Input: Best-case, worst-case and average-case analysis Problem: Upper bound, lower bound Rate of growth for algorithms: Definitions and notation (O, Ω, Θ, o, w) 8

Abstract Data Types Lists Operations: Insert, Delete, Search Implementations: vectors, singly-linked lists, double-linked lists, sentinels Analysis of operations for each implementation Stacks (LIFO) Operations: Push, Pop, Top Implementations: linked-list, vector Analysis of operations for each implementation Queues (FIFO) Operations: Enqueue, dequeue Implementations: linked-list, vector Analysis of operations for each implementation Standard Template Library (STL) Use of vector, list, stack and queue template classes Use of iterators Know all the tradeoffs (in time & space) between all these data structures 9

Trees (in memory) Definitions: root, leaf, child, parent, ancestor, descendant, path, height, depth Binary tree: Definition, traversals Storing/representation: All children: use array or list Store pointers to only Leftmost child and right sibling Other representations possible Tree traversals Inorder, postorder and preorder 10

Search Trees Binary search tree (BST) Definition Operations: Insert, Delete, Search, FindMin, FindMax, traversals Know how to perform these on a BST and show resulting BST Know worst-case and average-case analysis of performance Balanced BST (AVL trees) Definition Operations: Rotations & Cases, Insert, Lazy Delete, Search, FindMin, FindMax Know how to perform these on an AVL tree and show resulting AVL tree Know worst-case performance STL set and map classes Differences How to use them 11

Disk-based Search Trees B-trees Definition and properties Input parameters: B, D, K M and L, and how to choose them Operations: Insert, Delete, Search Know how to perform these on a B-tree and show resulting B-tree Know worst-case performance Know how to calculate height of a B-tree 12

Priority Queues Binary heap, Binomial heaps Structure and heap-order properties Implementation: Binary heap Tree structure can be implemented as an array Where nodes are stored in breadth-first order Children of node at A[i] are at: A[2i] and A[2i+1] Binomial heap Array of pointers to each binomial tree log n binomial tree pointers 13

Run-times for each heap operation Two main techniques: PercolateUp and PercolateDown Insert DeleteMin Merge Binary heap Binomial Heap O(1) - amortized O(1) O(log n) O(log n) Other operations: deletemax() decreasekey(p,v), increasekey(p,v) remove(p) O(n) O(log n) 14

Union-Find data structure Purpose: Disjoint set operations (union & find) Typical application: For computing subsets defined by equivalence relation Smart Union (by rank, by size) Smart Find (path compression) 15

Heuristics & their Gains Arbitrary Union, Simple Find Union-by-size, Simple Find Union-by-rank, Simple Find Arbitrary Union, Path compression Find Union-by-rank, Path compression Find Worst-case run-time for m operations O(m n) O(m log n) O(m log n) O(m log n) Extremely slow Growing function O(m Inv.Ackermann(m,n)) = O(m log*n) 16

Hashing Hash functions (purpose: string to integer) Choice of a good hash functions Reduce chance of collision Relatively smaller key value Does not need huge hash table size Hash table purpose: to search efficiently to map string labels to integer ids efficiently Load factor Know algorithms & analysis for the following Collision resolution by chaining Collision resolution by open-addressing Linear probing, quadratic probing Double hashing Rehashing 17

Sorting Know algorithms & analysis of all sort methods mentioned below Insertion sort Merge sort Heap sort Quick sort Lower bound for sorting Integer sorting Counting sort Bucket sort APPLICATIONS OF SORTING 18

Graphs Definitions Simple graph, directed graph, weighted graph Path, cycle Representation as adjacency matrix and adjacency list Topological sort: Algorithm and running time 19

Thank You & Good Luck! COURSE EVALUATIONS!! http://skylight.wsu.edu/s/60faae97-fb67-41c6-91e3-1466918cae31.srv 20