Interval Heaps
Complete binary tree.
Each node (except possibly last one) has 2 elements.
Last node has 1 or 2 elements.
Let a and b be the elements in a node P, a <= b.
[a, b] is the interval represented by P.
The interval represented by a node that has
Approved Calendar - 2016-2017 Academic Year
FALL SEMESTER 2016
SUMMER SEMESTER 2017
SPRING SEMESTER 2017
S M T W T F S
Registration
S M T W T F S
Holiday Registration - - - - - - - Drop/Add- - - - - - -
S M T W T F S
Registration
Aug.
Basic Data Structures:
Stacks and Queues
Neil Rhodes
Department of Computer Science and Engineering
University of California, San Diego
Data Structures
Data Structures and Algorithms
Outline
1 Stacks
2 Queues
Definition
Stack: Abstract data type with the
Analysis Of Binomial Heaps
Leftist trees O(log n) O(log n) O(log n) Binomial heaps Actual Amortized O(1) O(1) O(n) O(1) O(log n) O(1)
Insert Remove min (or max) Meld
Operations
Insert
Add a new min tree to top-level circular list.
Meld
Combine two cir
Leftist Trees
Linked binary tree. Can do everything a heap can do and in the same asymptotic complexity.
insert remove min (or max) initialize
Can meld two leftist tree priority queues in O(log n) time.
Extended Binary Trees
Start with any binary tree an
Interval Heaps
Complete binary tree. Each node (except possibly last one) has 2 elements. Last node has 1 or 2 elements. Let a and b be the elements in a node P, a <= b. [a, b] is the interval represented by P. The interval represented by a node that has
Double-Ended Priority Queues
Primary operations
Insert Remove Max Remove Min
Note that a single-ended priority queue supports just one of the above remove operations.
General Methods
Dual min and max single-ended priority queues. Correspondence based
Improve Run Merging
Reduce number of merge passes.
Use higher order merge. Number of passes = ceil(logk(number of initial runs) where k is the merge order.
More generally, a higher-order merge reduces the cost of the optimal merge tree.
Improve Run Mer
Improve Run Generation
Overlap input,output, and internal CPU work. Reduce the number of runs (equivalently, increase average run length).
DISK MEMORY DISK
Internal Quick Sort
6 2 8 5 11 10 4 1 9 7 3 Use 6 as the pivot (median of 3). Input first, middle,
Tournament Trees
Winner trees. Loser Trees.
Winner Tree Definition
Complete binary tree with n external nodes and n 1 internal nodes. External nodes represent tournament players. Each internal node represents a match played between its two children; the w
COP 3530
Data Structures and Algorithms
Credits: 4
Course Catalog Description: Algorithm development using pseudo languages, basic
program structures, program design techniques, storage and manipulation of basic data
structures like arrays, stacks, queues
COP 5536 Advanced Data Structures
Spring 2015
Instructor: Dr. Sartaj K Sahni (sahni@cise.ufl.edu)
Office Hours: Monday and Wednesday 2:00 pm to 3:00 pm
Phone: 352-450-1490
Office: E536 Computer Science and Engineering Building
TA (Office Hours):
Soham Das
Advanced Data Structures
Sartaj Sahni
Clip Art Sources
www.barrysclipart.com
www.livinggraphics.com
www.rad.kumc.edu
www.livinggraphics.com
What The Course Is About
Study data structures for:
External sorting
Single and double ended priority queues
Di
Improve Run Generation
Overlap input,output, and internal CPU work.
Reduce the number of runs (equivalently, increase average run
length).
DISK
MEMORY
DISK
Internal Quick Sort
6 2 8 5 11 10 4 1 9 7 3
Use 6 as the pivot (median of 3).
Input first, middle
Improve Run Generation
Overlap input,output, and internal CPU work.
Reduce the number of runs (equivalently, increase average run
length).
DISK
MEMORY
DISK
Internal Quick Sort
6 2 8 5 11 10 4 1 9 7 3
Use 6 as the pivot (median of 3).
Input first, middle
Tournament Trees
Winner trees.
Loser Trees.
Winner Tree Definition
Complete binary tree with n external
nodes and n 1 internal nodes.
External nodes represent tournament
players.
Each internal node represents a match
played between its two children;
the w
Double-Ended Priority Queues
Primary operations
Insert
Remove Max
Remove Min
Note that a single-ended priority queue
supports just one of the above remove
operations.
General Methods
Dual min and max single-ended priority
queues.
Correspondence bas
External Sorting
Sort n records/elements that reside on a disk.
Space needed by the n records is very large.
n is very large, and each record may be large or
small.
n is small, but each record is very large.
So, not feasible to input the n records, s
Advanced Data Structures
Sartaj Sahni
Clip Art Sources
www.barrysclipart.com
www.livinggraphics.com
www.rad.kumc.edu
www.livinggraphics.com
What The Course Is About
Study data structures for:
External sorting
Single and double ended priority queues
Di
Graduate
Guidelines
Department of
Electrical and Computer Engineering
Graduate Guidelines
Department of Electrical and Computer Engineering
University of Florida
P. O. Box 116200
Gainesville, FL 32611
Revised Fall 2015
Department Administration:
John Harr
External Sorting
Sort n records/elements that reside on a disk. Space needed by the n records is very large.
n is very large, and each record may be large or small. n is small, but each record is very large.
So, not feasible to input the n records, sor
Digital Search Trees & Binary Tries
Analog of radix sort to searching. Keys are binary bit strings.
Fixed length 0110, 0010, 1010, 1011. Variable length 01, 00, 101, 1011.
Application IP routing, packet classification, firewalls.
IPv4 32 bit IP addres