CS 3610 Midterm Review.

Slides:



Advertisements
Similar presentations
1 AVL Trees (10.2) CSE 2011 Winter April 2015.
Advertisements

Transform and Conquer Chapter 6. Transform and Conquer Solve problem by transforming into: a more convenient instance of the same problem (instance simplification)
Trees Types and Operations
S. Sudarshan Based partly on material from Fawzi Emad & Chau-Wen Tseng
AVL Tree Smt Genap Outline AVL Tree ◦ Definition ◦ Properties ◦ Operations Smt Genap
Binary Trees, Binary Search Trees CMPS 2133 Spring 2008.
Binary Trees, Binary Search Trees COMP171 Fall 2006.
CS 171: Introduction to Computer Science II
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,
CS 104 Introduction to Computer Science and Graphics Problems Data Structure & Algorithms (4) Data Structures 11/18/2008 Yang Song.
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,
TTIT33 Algorithms and Optimization – DALG Lecture 6 Jan Maluszynski - HT TTIT33- Algorithms and optimization Algorithms Lecture 5 Balanced Search.
© 2006 Pearson Addison-Wesley. All rights reserved11 A-1 Chapter 11 Trees.
Advanced Tree Data Structures Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
1 abstract containers hierarchical (1 to many) graph (many to many) first ith last sequence/linear (1 to 1) set.
Fundamentals of Python: From First Programs Through Data Structures
Data Structures Using C++ 2E Chapter 11 Binary Trees and B-Trees.
Bioinformatics Programming 1 EE, NCKU Tien-Hao Chang (Darby Chang)
Trees Chapter 15 Data Structures and Problem Solving with C++: Walls and Mirrors, Carrano and Henry, © 2013.
CS Data Structures Chapter 15 Trees Mehmet H Gunes
12-CRS-0106 REVISED 8 FEB 2013 CSG2A3 ALGORITMA dan STRUKTUR DATA.
CS Data Structures Chapter 5 Trees. Chapter 5 Trees: Outline  Introduction  Representation Of Trees  Binary Trees  Binary Tree Traversals 
Lecture 10 Trees –Definiton of trees –Uses of trees –Operations on a tree.
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.
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.
Final Review Dr. Yingwu Zhu. Goals Use appropriate data structures to solve real- world problems –E.g., use stack to implement non-recursive BST traversal,
Tree (new ADT) Terminology:  A tree is a collection of elements (nodes)  Each node may have 0 or more successors (called children)  How many does a.
Binary Trees, Binary Search Trees RIZWAN REHMAN CENTRE FOR COMPUTER STUDIES DIBRUGARH UNIVERSITY.
1 Binary Trees Informal defn: each node has 0, 1, or 2 children Informal defn: each node has 0, 1, or 2 children Formal defn: a binary tree is a structure.
Review for Final Andy Wang Data Structures, Algorithms, and Generic Programming.
Tree Data Structures.
Compiled by: Dr. Mohammad Omar Alhawarat
Prof. Amr Goneid, AUC1 CSCE 210 Data Structures and Algorithms Prof. Amr Goneid AUC Part 4. Trees.
Starting at Binary Trees
Binary Search Tree Traversal Methods. How are they different from Binary Trees?  In computer science, a binary tree is a tree data structure in which.
 Trees Data Structures Trees Data Structures  Trees Trees  Binary Search Trees Binary Search Trees  Binary Tree Implementation Binary Tree Implementation.
Binary trees -2 Chapter Threaded trees (depth first) Binary trees have a lot of wasted space: the leaf nodes each have 2 null pointers We can.
TREES. What is a tree ? An Abstract Data Type which emulates a tree structure with a set of linked nodes The nodes within a tree are organized in a hierarchical.
+ David Kauchak cs312 Review. + Midterm Will be posted online this afternoon You will have 2 hours to take it watch your time! if you get stuck on a problem,
Chapter 4: Trees Part I: General Tree Concepts Mark Allen Weiss: Data Structures and Algorithm Analysis in Java.
1 Chapter 7 Objectives Upon completion you will be able to: Create and implement binary search trees Understand the operation of the binary search tree.
Heaps & Priority Queues
Binary Tree. Some Terminologies Short review on binary tree Tree traversals Binary Search Tree (BST)‏ Questions.
CIS 068 Welcome to CIS 068 ! Lesson 12: Data Structures 3 Trees.
CISC220 Fall 2009 James Atlas Dec 07: Final Exam Review.
Lecture 10COMPSCI.220.FS.T Binary Search Tree BST converts a static binary search into a dynamic binary search allowing to efficiently insert and.
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.
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.
Foundation of Computing Systems Lecture 4 Trees: Part I.
 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.
1 Trees : Part 1 Reading: Section 4.1 Theory and Terminology Preorder, Postorder and Levelorder Traversals.
Trees By JJ Shepherd. Introduction Last time we discussed searching and sorting in a more efficient way Divide and Conquer – Binary Search – Merge Sort.
1 Trees. 2 Trees Trees. Binary Trees Tree Traversal.
Final Exam Review COP4530.
Trees Chapter 15.
CSCE 210 Data Structures and Algorithms
Tree.
ITEC 2620M Introduction to Data Structures
Binary Trees, Binary Search Trees
Review for Midterm Neil Tang 03/04/2010
Final Exam Review COP4530.
Binary Trees, Binary Search Trees
Binary Search Trees Chapter 7 Objectives
Final Review Dr. Yingwu Zhu.
Chapter 20: Binary Trees.
Binary Trees, Binary Search Trees
A Binary Tree is a tree in which each node has at most 2 children
Presentation transcript:

CS 3610 Midterm Review

Analysis of time complexity Iterative algorithms Sum up individual components Recursive algorithms The time complexity is commonly expressed as a recursive equation We can solve it be repeated replacements

Analysis of time complexity Worst case cost Best case cost Average case \big-O, \big-Omega, \big-Theta notations

Big-O, big-Omega, big-Theta Definitions Proof

STL (C++98) overview Three basic components of the STL: Containers, iterators, and algorithms Basic concepts of sequence containers: vector, deque, list Functionalities Basic operations Basic concepts of iterators

Recursions Recursive definitions, recursive algorithms and recursive functions the base case and the general case of a recursive definition how to design recursive algorithms Examples: Fibonacci number, tower of Hanoi, etc.

Recursions Recursion vs. iteration The concept of backtracking Efficiency issue, general-purpose conversion (won’t show up in the exam) Simple conversions (may show up) The concept of backtracking Examples; understand the procedure. Similarity and difference w.r.t. depth-first search.

Generic Trees Definitions Terminology Root + disjoint subtrees Terminology Height, degree of a node, degree of a tree, level of a node, Left child/right sibling representation

Binary trees Properties (# of leaf nodes, max # of nodes at certain level, max # of nodes for certain height) Complete vs. full binary trees Array representation of complete binary trees Linked representation of binary trees

Binary tree traversals Different orders Inorder Preorder Postorder Level-order (won’t show up)

Recursion vs. iteration Recursive programs, Calculate the number of leave nodes, height of a binary tree, etc. Inorder, preorder, postorder traversals The iterative version Inorder, preorder, postorder

Binary search trees Basic operations: Complexities of the operations Search, insertion, deletion, finding the minimum, finding the maximum, inorder traversal. Complexities of the operations

AVL trees Basic operations: Balance a tree after insertion Definition; balance factor Search, insertion, deletion, finding the minimum, finding the maximum, inorder traversal. Balance a tree after insertion Single rotation; when to happen, how to do it? Double rotation; when to happen, how to do it?

Heap Heap (Max-heap vs. Min-heap) Complexities Heap property, representation, height, indexes Operations on heaps: insertion (bubble up), Delete-max (bubble down), build a heap (bottom up) heap-sort Complexities

B-trees m-way search trees: generalization of binary search trees Definition of b-trees Search a key in a b-tree Insert a new key in a b-tree May need to split a node, and move up the median key to the parent Delete a key in a b-tree May need rotation & merge

Structure of the exam Definitions/basic properties (20-30%) Operations on certain inputs (20-30%) Code analysis (20-30%) Code writing (20-30%) Other