Review for Final Andy Wang Data Structures, Algorithms, and Generic Programming.

Slides:



Advertisements
Similar presentations
1 abstract containers hierarchical (1 to many) graph (many to many) first ith last sequence/linear (1 to 1) set.
Advertisements

Lecture 16: Tree Traversal.
Binary Trees, Binary Search Trees COMP171 Fall 2006.
CS 171: Introduction to Computer Science II
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
Binary Trees A binary tree is made up of a finite set of nodes that is either empty or consists of a node called the root together with two binary trees,
Fall 2007CS 2251 Iterators and Tree Traversals. Fall 2007CS 2252 Binary Trees In a binary tree, each node has at most two subtrees A set of nodes T is.
CS 104 Introduction to Computer Science and Graphics Problems Data Structure & Algorithms (4) Data Structures 11/18/2008 Yang Song.
BST Data Structure A BST node contains: A BST contains
Review for Test 2 i206 Fall 2010 John Chuang. 2 Topics  Operating System and Memory Hierarchy  Algorithm analysis and Big-O Notation  Data structures.
Lec 15 April 9 Topics: l binary Trees l expression trees Binary Search Trees (Chapter 5 of text)
Course Review COMP171 Spring Hashing / Slide 2 Elementary Data Structures * Linked lists n Types: singular, doubly, circular n Operations: insert,
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L12 (Chapter 20) Lists, Stacks,
1 abstract containers hierarchical (1 to many) graph (many to many) first ith last sequence/linear (1 to 1) set.
1 Foundations of Software Design Fall 2002 Marti Hearst Lecture 17: Binary Search Trees; Heaps.
Chapter 18 - basic definitions - binary trees - tree traversals Intro. to Trees 1CSCI 3333 Data Structures.
Data Structures Arrays both single and multiple dimensions Stacks Queues Trees Linked Lists.
Types of Binary Trees Introduction. Types of Binary Trees There are several types of binary trees possible each with its own properties. Few important.
Review – Part 1 CSE 2011 Winter September 2015.
1 Trees Tree nomenclature Implementation strategies Traversals –Depth-first –Breadth-first Implementing binary search trees.
Chapter 19: Binary Trees. Objectives In this chapter, you will: – Learn about binary trees – Explore various binary tree traversal algorithms – Organize.
Lecture 17 Non-Linear data structures Richard Gesick.
CS 3610 Midterm Review.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Course Review Midterm.
Chapter 19 Implementing Trees and Priority Queues Fundamentals of Java.
1 Trees A tree is a data structure used to represent different kinds of data and help solve a number of algorithmic problems Game trees (i.e., chess ),
Chapter 19 Implementing Trees and Priority Queues Fundamentals of Java.
Recursive Data Structures and Grammars  Themes  Recursive Description of Data Structures  Grammars and Parsing  Recursive Definitions of Properties.
Final Exam Review CS Total Points – 60 Points Writing Programs – 50 Points Tracing Algorithms, determining results, and drawing pictures – 50.
© 2006 Pearson Education Chapter 10: Non-linear Data Structures Presentation slides for Java Software Solutions for AP* Computer Science A 2nd Edition.
Data Structures academy.zariba.com 1. Lecture Content 1.Linear Data Structures 2.Trees and Graphs* 3.Dictionaries and Hash Tables 4.Homework 2.
Computer Science 112 Fundamentals of Programming II Introduction to Trees.
CSE 3358 NOTE SET 10 Data Structures and Algorithms.
Review for Final Exam – cs411/511 Definitions (5 questions, 2 points each) Algorithm Analysis (3 questions, 3 points each) General Questions (3 questions,
CSE205 Review Session SAMUEL & JESSA. Recursion WHAT IS RECURSION?  Recursion is a tool a programmer can use to invoke a function call on itself. 
CISC220 Fall 2009 James Atlas Dec 07: Final Exam Review.
1 Trees 2 Binary trees Section Binary Trees Definition: A binary tree is a rooted tree in which no vertex has more than two children –Left and.
Trees Ellen Walker CPSC 201 Data Structures Hiram College.
1 Trees General Trees  Nonrecursive definition: a tree consists of a set of nodes and a set of directed edges that connect pairs of nodes.
Binary Tree Implementation. Binary Search Trees (BST) Nodes in Left subtree has smaller values Nodes in right subtree has bigger values.
1 Joe Meehean. A A B B D D I I C C E E X X A A B B D D I I C C E E X X  Terminology each circle is a node pointers are edges topmost node is the root.
Hello Everyone!!! 1. Tree And Graphs 2 Features of Trees  Tree Nodes Each node have 0 or more children A node have must one parent  Binary tree Tree.
CSCI 383 Object-Oriented Programming & Design Lecture 25 Martin van Bommel.
 Saturday, April 20, 8:30-11:00am in B9201  Similar in style to written midterm exam  May include (a little) coding on paper  About 1.5 times as long.
Final Exam Review CS Total Points – 20 Points Writing Programs – 65 Points Tracing Algorithms, determining results, and drawing pictures – 50.
1 Trees General Trees  Nonrecursive definition: a tree consists of a set of nodes and a set of directed edges that connect pairs of nodes.
Fundamentals of Algorithms MCS - 2 Lecture # 17. Binary Search Trees.
Final Exam Review COP4530.
Final Exam Review CS 3358.
Data Structures and Algorithms
Trees Chapter 15.
Fundamentals of Programming II Introduction to Trees
Midterm Review.
Exam Hints.
Binary Search Tree (BST)
Section 8.1 Trees.
Data Structures and Algorithms
i206: Lecture 13: Recursion, continued Trees
Map interface Empty() - return true if the map is empty; else return false Size() - return the number of elements in the map Find(key) - if there is an.
CSE 326: Data Structures: Midterm Review
Trees 1: Theory, Models, Generic Heap Algorithms, Priority Queues
Final Exam Review COP4530.
ITEC 2620M Introduction to Data Structures
Binary Trees, Binary Search Trees
Final Review Dr. Yingwu Zhu.
Chapter 20: Binary Trees.
EE 312 Final Exam Review.
Non-Linear data structures
Binary Trees, Binary Search Trees
Andy Wang Data Structures, Algorithms, and Generic Programming
Presentation transcript:

Review for Final Andy Wang Data Structures, Algorithms, and Generic Programming

Final Exam (Wed 12/3) 25%: Lectures %: Lectures %: Lectures

Strings and BitVectors Three characteristics of a proper type Two major advantages of C++ strings over C strings How to set/unset/test nth bit in a char

Hash functions and templates Hash functions Description Properties Three design principles for hashing a sequence of keys Implement simple template classes/functions

Search Algorithms Definition of invariants Big “O” notation (worst case running time)

Linked Lists and Deques List vs. vector vs. deque Implement list operations Why multiple iterators for a given class pContainers vs. aContainers How to compute the size of a deque and why

Stacks and Queues Implement of DFS and BFS in pseudo code How to implement a queue with a stack How to implement a stack with a queue

Function Objects and Generic Algorithms Advantages of function objects Implement generic copy, find, max, sort Running time of generic sort

Iterators and Generic Set Algorithms Types of iterators and when to use what Conceptual understanding of set operations Implement union, intersection, difference, containment, merge

Sets and Maps How to use set operations to find out words not in a dictionary How to use sets to implement maps How to use maps to implement linked lists and trees

Trees 1 Definitions: graph, tree, depth, leaf, binary tree, complete binary tree, partially ordered tree, heap Traversals: preorder, postorder, levelorder, inorder How to use nodes listed in different orders to uniquely identify a tree

Trees 1 Total number of vertices in a complete binary tree Total number of leafs in a complete binary tree What if we have a complete tri- nary tree?

Trees 1 How to use a vector to represent a complete binary tree How do you access parent, left child, and right child? Heap operations Push (bottom up) Pop (top down)

Trees 1 Heap operations Push (bottom up) Pop (top down)

Trees 2 Tree navigators vs. iterators For a complete binary tree, which node is the first node for an inorder traversal? Which node is the last?

Trees 2 For a complete binary tree, which node is the first node for a preorder traversal? Which node is the last?

Trees 2 For a complete binary tree, which node is the first node for a postorder traversal? Which node is the last?

Trees 2 For a complete binary tree, which node is the first node for a levelorder traversal? Which node is the last? How to implement a levelorder binary tree iterator

Trees 3 How to store a tree in a file How to perform node insertion and removal

Trees 4 Definition: totally ordered tree How to perform a binary tree with a binary search tree Best and worst running time of binary search via a binary search tree

Trees 4 How to improve the average running time of binary search via a binary search tree