Topics covered (since exam 1):

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.
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.
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.
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.
Indexing. Goals: Store large files Support multiple search keys Support efficient insert, delete, and range queries.
B-Trees and Red Black Trees. Binary Trees B Trees spread data all over – Fine for memory – Bad on disks.
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.
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 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.
Review for Final Exam Non-cumulative, covers material since exam 2 Data structures covered: –Treaps –Hashing –Disjoint sets –Graphs For each of these data.
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.
Exam 3 Review Data structures covered: –Hashing and Extensible hashing –Priority queues and binary heaps –Skip lists –B-Tree –Disjoint sets For each of.
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.
CSE373: Data Structures & Algorithms Lecture 8: AVL Trees and Priority Queues Linda Shapiro Spring 2016.
SPLAY TREE The basic idea of the splay tree is that every time a node is accessed, it is pushed to the root by a series of tree rotations. This series.
1 Red-Black Trees. 2 A Red-Black Tree with NULLs shown Black-Height of the tree = 4.
Lecture 23 Red Black Tree Chapter 10 of textbook
CSE 326: Data Structures Trees
COMP261 Lecture 23 B Trees.
Definitions and Bottom-Up Insertion
AA Trees.
Binary search trees Definition
G64ADS Advanced Data Structures
Multiway Search Trees Data may not fit into main memory
Heaps, Heap Sort and Priority Queues
Topics covered (since exam 1):
Red Black Trees
Splay Trees.
SPLAY TREE Features Binary Search Tree Self adjusting balanced tree
Hashing Exercises.
Source: Muangsin / Weiss
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
Dynamic Dictionaries Primary Operations: Additional operations:
O(lg n) Search Tree Tree T is a search tree made up of n elements: x0 x1 x2 x3 … xn-1 No function (except transverse) takes more than O(lg n) in the.
Red Black Trees.
Lecture 25 Splay Tree Chapter 10 of textbook
Review for Final Exam Non-cumulative, covers material since exam 2
CMSC 341 Lecture 10 B-Trees Based on slides from Dr. Katherine Gibson.
original list {67, 33,49, 21, 25, 94} pass { } {67 94}
CMSC 341: Data Structures Priority Queues – Binary Heaps
Review for Exam 1 Topics covered: For each of these data structures
Wednesday, April 18, 2018 Announcements… For Today…
Topics covered (since exam 1):
Binary Heaps Priority Queues
CMSC 341 Lecture 14 Priority Queues & Heaps
Red-Black Trees Bottom-Up Deletion.
Heaps and the Heapsort Heaps and priority queues
Binary Heaps Priority Queues
Red-Black Trees.
Heap Sort CSE 2011 Winter January 2019.
Topics covered (since exam 1, excluding PQ):
CMSC 341 Splay Trees.
Definition Applications Implementations Heap Comparison
CMSC 341 Lecture 19.
Review for Final Exam Non-cumulative, covers material since exam 2
CSE 326: Data Structures Splay Trees
CMSC 341 Splay Trees.
Topics covered (since exam 1):
การวิเคราะห์และออกแบบขั้นตอนวิธี
CS 6310 Advanced Data Structure Wei-Shian Wang
CSE 373 Data Structures Lecture 12
326 Lecture 9 Henry Kautz Winter Quarter 2002
Splay Trees Binary search trees.
Presentation transcript:

Topics covered (since exam 1): Review for Exam 2 Topics covered (since exam 1): Splay Tree K-D Trees RB Tree B-Tree Priority Queue and Binary Heap 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 Review for Exam 2 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

Review for Exam 2 B-Trees What is a B-tree Why need 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(logM 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, data element, and disk block

PQ and Heap Binary heap Heap operations (implemented with array) 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