Advanced Data Structures
Clip Art Sources
What The Course Is About
Study data structures for:
Single and double ended priority queues
for every node x, define its balance factor
balance factor of x = height of left subtree of x
height of right subtree of x
balance factor of every node x is 1, 0, or 1
log2 (n+1) <= height <= 1.44 log2 (n+2)
Example AVL Tree
Collection of items.
Each item is a pair.
Pairs have different keys.
Collection of student records in this class.
(key, element) = (student name, linear list of
assignment and exam scores)
All keys are distin
COP5536 - Exam 3
Page 1 of 5
Problem 1 (10) Draw a clearly labeled suffix tree for the string addaadd#. Show how you arrived
at this suffix tree.
addaadd\# => 12345678
(number) = end node
B = branch node
One step 1 point, and fin
COP5536 Advanced Data Structures
Duration: 60 mins
Prof. Sartaj Sahni
PLEASE READ THE FOLLOWING INSTRUCTIONS CAREFULLY
1. For all problems, use only the algorithms discussed in class/text.
2. Write your answers directly on the exam ques
Imagine that a data structure is represented as an array whose initial length is 1. The data
structure operations are insert and remove.
1) An insert takes 1 time unit except when the number of elements in the data structure prior
to the insert
1. The assignment is due at 11:55 PM on May 27 for EDGE students. For those who need to
turn in a hard copy, please come to my office hour (1:30 5:30 PM) on May 27. Late
submission will NOT be accepted.
2. On-Campus students need to submit a hardcopy to t
1.  (Red-black Tree)
Consider a Red-Black Tree, which is initially drawn as below.
Now insert the following keys in the given order: 13, 110, 79, 92, 10. While inserting,
draw figures (double edge means red and single means black) depicting y
Double-Ended Priority Queues
Note that a single-ended priority queue
supports just one of the above remove
Dual min and max single-ended priority
Basic data structure in computational geometry.
Computations with geometric objects.
Points in 1-, 2-, 3-, d-space.
Closest pair of points.
Nearest neighbor of given point.
Lines in 1-, 2-, 3-, d-space.