Quad Trees
CMSC 420
Applications of Geometric / Spatial Data Structs.
Computer graphics, games, movies computer vision, CAD, street maps (google maps / google Earth) Human-computer interface design
kd-Trees Continued
Generalized, incremental NN, range searching, kd-tree variants
kd-tree Variants
How do you pick the cutting dimension?
kd-trees cycle through them, but may be better to pick a diffe
Skip Lists
CMSC 420
Linked Lists Benefits & Drawbacks
Benefits:
Easy to insert & delete in O(1) time Don't need to estimate total memory needed
Drawbacks:
Hard to search in less than O(n) time (binary
Minimum Spanning
Trees
CMSC 420: Lecture 11
Following Dave Mounts
lecture in his lecture notes.
Skew Heaps
Self-adjusting version of leftist heaps
Difference:
Dont store npl (or any other auxiliary in
B-Trees
CMSC 420: Lecture 9
Another way to achieve "balance"
Height of a perfect binary tree of n nodes is O(log n). Idea: Force the tree to be perfect.
Problem: can't have an arbitrary # of nodes
Leftist Heaps
CMSC 420: Lecture 10
Priority Queue ADT
Efficiently support the following operations on a set of keys:
findmin: return the smallest key deletemin: return the smallest key & delete it i
Splay Trees
CMSC 420: Lecture 8
AVL Trees
Nice Features:
Worst case O(log n) performance guarantee Fairly simple to implement
Problem though:
Have to maintain extra balance factor storage at each node
Binary Search Trees
CMSC 420: Lecture 6
Binary Tree Traversals
B
A
C
D
E
F
G
H
I
J void traverse(BinNode *T) cfw_ if(T != NULL) cfw_ PREORDER(T); traverse(T->left(); INORDER(T); traverse(T->right(); P
Trees
CMSC 420: Lecture 5
Hierarchies
Many ways to represent tree-like information:
A B D E F C G
linked hierarchy
I. A 1. B a. D i. E b. F 2. C a. G
outlines, indentations
A E D G C F B
(E):D), F):B,
Lists, Queues, Stacks, Deques
Lecture 2: CMSC 420
General List ADT
The simplest (and often most useful) data structure is a
linear list: only care about linear ordering of items.
Supports the follow
What you should know about C+
Lecture 1.5: CMSC 420
C+
Almost every C program is a C+ program. That was an explicit goal of the design of C+. Why are we covering C+?
Important language, nearly the li
Problem Set #1: Basic Data Structures
Handed out on Feb. 12, due on Feb. 26 at the beginning of class. Remember: write your own
answers and use English or pseudocode when algorithms are requested. Lat
Problem Set #2: Balanced Trees
Handed out on Feb. 26, due on Mar 4, at the beginning of class. Remember: write your own
answers and use English or pseudocode when algorithms are requested. Late homewo
Problem Set #3: Heaps, Sorting, and MST
Handed out on Tues, Mar 4, due on Tues, Mar 11 at the beginning of class. Remember: write your
own answers and use English or pseudocode when algorithms are req