Project Cover Page
This project is a group project. For each group member, please print rst and last name and e-mail address.
1.
2.
3.
Please write how each member of the group participated in the project.
1.
2.
3.
Please list all sources: web pages, peop
3a
Locators
1g
4/1/2013 10:43 AM
Locators
4e
1
Outline and Reading
Locators (7.4, 9.6)
Locator-based methods (7.4.1)
Implementation
Positions vs. Locators
4/1/2013 10:43 AM
Locators
2
Locators
A locators identifies and tracks a
(key, element) item within
CSCE 221
Data Structures and Algorithms
Huffman Tree
The Huffmans algorithm is wildly used technique for data compression saving from 20% to
90% of space depending on the characteristic of the data being compressed. The algorithm
starts with creating a fr
CPSC 221
Data Structures & Algorithms
Priority Queue ADT
Denition
A priority queue P is a data type for ordering a set (collection) S
of elements each with an associated value called a key. The keys
can be put in order from the smallest to largest key (or
CPSC 221
Data Structures & Algorithms
Heap Data Structure
A heap is a binary tree in which each nodes value is less than or equal to
the values of nodes in its left and right subtrees.
A dense (complete) binary tree of height m is a full binary tree satis
Skip Lists
S3 -
+
S2 -
15
S1 -
15
23
15
23
S0 -
2010 Goodrich, Tamassia
Skip Lists
10
+
+
36
+
1
What is a Skip List
A skip list for a set S of distinct (key, element) items is a series of
lists S0, S1 , , Sh such that
Each list Si contains the special k
CSCE 221
Data Structures & Algorithms
How fast can we search?
Arrays
Linked Lists
Binary Trees
Unsorted
Sorted
Unsorted
Sorted
UnBal.
Bal.
O(n)
O(log2 n)
O(n)
O(n)
O(n)
O(log2 n)
Hash Tbl
Graphs
Dense
O(1)
Sparse
O(n2 )
O(n)
A dictionary is a data structu
SplayTrees
v
6
8
3
4
2004Goodrich,Tamassia,Dickerson
SplayTrees
z
1
SplayTreesareBinarySearchTrees
note that two keys of
equal value may be wellseparated
(10,A)
BSTRules:
entriesstoredonlyat
internalnodes
keysstoredatnodesinthe
leftsubtreeofvareless
thano
Splay Trees
6
v
8
3
z
4
2004 Goodrich, Tamassia, Dickerson
Splay Trees
1
Splay Trees are Binary Search Trees
all the keys in the blue
region are 20
(20,Z)
note that two keys of
equal value may be wellseparated
(10,A)
(35,R)
BST Rules:
entries stored only
CPSC 211
Data Structures & Implementations
2-3 Trees
This is another tree-based technique for implementing an ordered list
called a 2-3 tree. This technique can improve the efciency of a
height-balanced tree by guaranteeing a search path that never exceed
CPSC 221
Data Structures & Algorithms
Height-Balanced Trees
Search process is much faster using trees (O(log2 n) than using linked
lists (O(n). But if a tree is unbalanced then this advantage is lost, and
search process is O(n).
Well balanced
Unbalanced
t
Trees
MakeMoneyFast!
Stock
Fraud
2010Goodrich,Tamassia
Ponzi
Scheme
Trees
Bank
Robbery
1
WhatisaTree
Incomputerscience,a
treeisanabstractmodel
ofahierarchical
structure
Atreeconsistsofnodes
withaparentchild
relation
US
Applications:
ComputersRUs
Sales
Int
BreadthFirstSearch
L0
L1
B
L2
2010Goodrich,Tamassia
A
BreadthFirstSearch
C
E
D
F
1
BreadthFirstSearch
Breadthfirstsearch
(BFS)isageneral
techniquefortraversing
agraph
ABFStraversalofa
graphG
Visitsalltheverticesand
edgesofG
DetermineswhetherGis
connected
CSCE 221 Assignment 6 Cover Page
First Name
Last Name
User Name
UIN
E-mail address
Please list all sources in the table below including web pages which you used to solve or implement the current homework.
If you fail to cite sources you can get a lower nu
CSCE 221 Assignment 5 Cover Page
First Name
Last Name
User Name
UIN
E-mail address
Please list all sources in the table below including web pages which you used to solve or implement the
current homework. If you fail to cite sources you can get a lower nu
CSCE 221 Assignment 4 Cover Page
First Name
Last Name
User Name
UIN
E-mail address
Please list all sources in the table below including web pages which you used to solve or implement the
current homework. If you fail to cite sources you can get a lower nu
CSCE 221 Assignment 3
Due March 1 at 11:59pm
Hardcopy Report: Return to your TA in labs that week
Part 1: Implementing Queue and Stack Based on Linked List
Objective
This is an individual assignment which has two parts. Part 1 involves implementing Queue
Assignment 1 (100 pts)
Due February 1, 2013 by midnight to CSNet
Hard copy of the report is due Monday/Tuesday in your lab
The purpose of this programming assignment is to learn about organizing data using the STL classes vector and
list, analyzing the be
CPSC 221
Data Structures & Algorithms
Minimum Spanning Tree
Minimum Spanning Tree (MST) of a given undirected, connected and
weighted graph G = (V, E ) is a subgraph G = (V, E ) containing all the
vertices of G and subset of edges with the minimum weight
G = (V, E )
s V v V
G = (V, E )
w : E R
p = v0 , v1 , . . . , vk
k
X
w(vi1 , vi ).
i=1
u v
8
< mincfw_ w(p) : u
(u, v ) =
: ,
p
p
v ,
u
w(p) = (u, v )
u v
.
v