Review for Exam 2 Topics covered (since exam 1): –Splay Tree –K-D Trees –RB Tree –Priority Queue and Binary Heap –B-Tree For each of these data structures.

Slides:



Advertisements
Similar presentations
Definitions and Bottom-Up Insertion
Advertisements

CMSC 341 Binary Heaps Priority Queues. 8/3/2007 UMBC CSMC 341 PQueue 2 Priority Queues Priority: some property of an object that allows it to be prioritized.
1 Self-Adjusting Data Structures. 2 Lists [D.D. Sleator, R.E. Tarjan, Amortized Efficiency of List Update Rules, Proc. 16 th Annual ACM Symposium on Theory.
Priority Queues And the amazing binary heap Chapter 20 in DS&PS Chapter 6 in DS&AA.
AA Trees another alternative to AVL trees. Balanced Binary Search Trees A Binary Search Tree (BST) of N nodes is balanced if height is in O(log N) A balanced.
EECS 311: Chapter 4 Notes Chris Riesbeck EECS Northwestern.
More sorting algorithms: Heap sort & Radix sort. Heap Data Structure and Heap Sort (Chapter 7.6)
1 Red-Black Trees. 2 Black-Height of the tree = 4.
1 Red-Black Trees. 2 Black-Height of the tree = 4.
1 COSC 2P03 Lecture #5 – Trees Part III, Heaps. 2 Today Take up the quiz Assignment Questions Red-Black Trees Binary Heaps Heap sort D-Heaps, Leftist.
CSE 373 Data Structures Lecture 12
TTIT33 Algorithms and Optimization – DALG Lecture 6 Jan Maluszynski - HT TTIT33- Algorithms and optimization Algorithms Lecture 5 Balanced Search.
Trees and Red-Black Trees Gordon College Prof. Brinton.
CSE 326: Data Structures Lecture #13 Extendible Hashing and Splay Trees Alon Halevy Spring Quarter 2001.
Balanced Trees. Binary Search tree with a balance condition Why? For every node in the tree, the height of its left and right subtrees must differ by.
Splay Trees and B-Trees
1 Red-Black Trees. 2 Definition: A red-black tree is a binary search tree where: –Every node is either red or black. –Each NULL pointer is considered.
Advanced Data Structures and Algorithms COSC-600 Lecture presentation-6.
Indexing. Goals: Store large files Support multiple search keys Support efficient insert, delete, and range queries.
B-Tree. B-Trees a specialized multi-way tree designed especially for use on disk In a B-tree each node may contain a large number of keys. The number.
PRIORITY QUEUES (HEAPS). Queues are a standard mechanism for ordering tasks on a first-come, first-served basis However, some tasks may be more important.
The Binary Heap. Binary Heap Looks similar to a binary search tree BUT all the values stored in the subtree rooted at a node are greater than or equal.
B-Trees and Red Black Trees. Binary Trees B Trees spread data all over – Fine for memory – Bad on disks.
Advanced Data Structures and Implementation Top-Down Splay Trees Top-Down Splay Trees Red-Black Trees Red-Black Trees Top-Down Red Black Trees Top-Down.
CMSC 341 Binary Heaps Priority Queues. 2 Priority: some property of an object that allows it to be prioritized WRT other objects (of the same type) Priority.
CMSC 341 B- Trees D. Frey with apologies to Tom Anastasio.
AVL Tree Definition: Theorem (Adel'son-Vel'skii and Landis 1962):
Balanced Search Trees Problem: Efficiency of BST is related to tree’s height.  search, insert and remove follow a path from root to desired location 
1 Tree Indexing (1) Linear index is poor for insertion/deletion. Tree index can efficiently support all desired operations: –Insert/delete –Multiple search.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Xiaoying Gao, Peter Andreae, VUW B Trees and B+ Trees COMP 261.
WEEK 3 Leftist Heaps CE222 Dr. Senem Kumova Metin CE222_Dr. Senem Kumova Metin.
Review for Exam 1 Topics covered: –Asymptotic analysis –Lists and list implementations Stacks and queues –General trees, binary trees –BST For each of.
Review for Final Exam Non-cumulative, covers material since exam 2 Data structures covered: –Treaps –Hashing –Disjoint sets –Graphs For each of these data.
8 January Heap Sort CSE 2011 Winter Heap Sort Consider a priority queue with n items implemented by means of a heap  the space used is.
1 CSE 326: Data Structures Trees. 2 Today: Splay Trees Fast both in worst-case amortized analysis and in practice Are used in the kernel of NT for keep.
CMSC 341 Binary Heaps Priority Queues. 2 Priority: some property of an object that allows it to be prioritized WRT other objects (of the same type) Priority.
Internal and External Sorting External Searching
Exam 3 Review Data structures covered: –Hashing and Extensible hashing –Priority queues and binary heaps –Skip lists –B-Tree –Disjoint sets For each of.
CSC 2300 Data Structures & Algorithms March 13, 2007 Chapter 6. Priority Queues.
Review for Exam 2 Topics covered: –Recursion and recursive functions –General rooted trees –Binary Search Trees (BST) –Splay Tree –RB Tree –K-D Trees For.
8/3/2007CMSC 341 BTrees1 CMSC 341 B- Trees D. Frey with apologies to Tom Anastasio.
ITEC 2620M Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: ec2620m.htm Office: TEL 3049.
1 Red-Black Trees. 2 A Red-Black Tree with NULLs shown Black-Height of the tree = 4.
COMP261 Lecture 23 B Trees.
Definitions and Bottom-Up Insertion
AA Trees.
Multiway Search Trees Data may not fit into main memory
Topics covered (since exam 1):
Red Black Trees
CMSC 341 Lecture 13 Leftist Heaps
Review for Final Exam Non-cumulative, covers material since exam 2
Review for Final Exam Non-cumulative, covers material since exam 2
Red Black Trees.
Review for Final Exam Non-cumulative, covers material since exam 2
Advanced Topics in Data Management
original list {67, 33,49, 21, 25, 94} pass { } {67 94}
Topics covered (since exam 1):
Binary Heaps Priority Queues
Topics covered (since exam 1):
CMSC 341 Lecture 14 Priority Queues & Heaps
Binary Heaps Priority Queues
Red-Black Trees.
Heap Sort CSE 2011 Winter January 2019.
Topics covered (since exam 1, excluding PQ):
Definition Applications Implementations Heap Comparison
CMSC 341 Lecture 19.
Review for Final Exam Non-cumulative, covers material since exam 2
Topics covered (since exam 1):
CS 6310 Advanced Data Structure Wei-Shian Wang
Splay Trees Binary search trees.
Presentation transcript:

Review for Exam 2 Topics covered (since exam 1): –Splay Tree –K-D Trees –RB Tree –Priority Queue and Binary Heap –B-Tree For each of these data structures –Basic idea of data structure and operations –Be able to work out small example problems –Prove related theorems –Asymptotic time performance –Advantages and limitations –comparison

Review for Exam 2 Splay tree –Definition (a special BST: balanced in some sense) –Rationale for splaying: amortized performance –Splay operation (bottom up) Rotation without grandparent with grandparent: zig-zag and zig-zig –When to splay (after each operation) –What to splay with find/insert/delete operations –Amortized time performance analysis: what does O(m log n) mean?

K-D Trees –What K-D trees are used for Multiple keys Range queries –How K-D trees differ from the ordinary BST levels –Be able to do insert and range query/print –Limitations Hard to do deletion Difficult to balance Review for Exam 2

RB tree –Definition: a BST satisfying 5 conditions Every node is either red or black. Root is black Each NULL pointer is considered to be a black node If a node is red, then both of its children are black. Every path from a node to a NULL contains the same number of black nodes. –Theorems leading to O(log n) worst case time performance Black height min and max # of nodes a RB tree with bh=k can have –Bottom-up insertion and deletion When and what to rotate and recolor

–Binary heap Definition: CBT with a partial order (heap order) Why it is good for PQ –Heap operations (implemented with array) findMin, deleteMin, insert percolateUp (for insertion), percolateDown (for deletion) Heap construction (heapify), Heap sort –Time performance of these operations –Leftist tree and leftist heap Why we need this? Definition (npl: null path length) Meld operations and applications –insert, deletMin, heap construction Review for Exam 2

B-Trees –What is a B-tree Special M-way search tree (what is a M-way tree) Internal and external nodes M and L (half full principle), especial requirement for root –Why need B-tree Useful/advantageous only when external storage accesses required and why? Height O(log M N), performances for find/insert/remove –B-tree operations search insert (only insert to nonempty leaf, split, split propagation) Remove (borrow, merge, merge propagation, update ancestors’ keys ) –B-tree design determining M and L based on the size of key, pointer, data element, and disk block Review for Exam 2