Elementary
Elementary Graph
Graph Algorithms
Algorithms
Comp 122, Fall 2004
Graphs
Graph G = (V, E)
V = set of vertices
E = set of edges (VV)
Types of graphs
Undirected: edge (u, v) = (v, u); for all v, (v, v) E (No self
loops.)
Directed: (u, v) is

Lower
Lower Bounds
Bounds &
&
Sorting
Sorting in
in Linear
Linear Time
Time
Comp 122, Spring 2004
Comparison-based Sorting
Comparison sort
Only comparison of pairs of elements may be used to gain
order information about a sequence.
Hence, a lower bound

What to Expect
from Cloud
Computing
an
Networking eBook
Contents
What to Expect from Cloud Computing
This content was adapted from Internet.coms ServerWatch, Datamation, and
CIO Update Web sites. Contributors: Paul Rubens, Pam Baker, Robert McGarvey,
and

COMP 122 Design and
Analysis of Algorithms
Spring 2004
MW 11:00-12:15, SN 014
http:/blackboard.unc.edu
Instructor:
Jack Snoeyink
TA:
SN 333, 962-1969
[email protected]
Office Hours: M 12:15-1, Tu 3:30-5pm
Nathan Fisher
SN 037
[email protected]
M 2-3pm,

Todays puzzle
How far can you reach with a stack of n blocks,
each 2 units long?
ort - 1
d(n)
Comp 122
Lin / Devi
Quicksort
Quicksort - Randomized
Randomized
Comp 122, Spring 2004
ort - 4
Quicksort: review
Partition(A,
Partition(A,p,p,r)r)
x,x,ii :=
:=A[

How should a computer shuffle?
Goal
Input: Given n items to shuffle (cards, )
Output: Return some list of exactly those n items;
all n! lists should be equally likely.
Not the same as saying each card is equally likely at
each position! Why not?
Possi

Dynamic
Dynamic Programming
Programming
Comp 122, Fall 2004
Longest Common Subsequence
Problem: Given 2 sequences, X = x1,.,xm and
Y = y1,.,yn, find a common subsequence whose
length is maximum.
springtime
ncaa tournament
basketball
printing
north caroli

Graph
Graph Algorithms
Algorithms 22
Comp 122, Spring 2004
Identification of Edges
Edge type for edge (u, v) can be identified when it is first explored
by DFS.
Identification is based on the color of v.
aphs-2 - 2
White tree edge.
Gray back edge.
Bl

Divide and Conquer
Recursive in structure
Divide the problem into sub-problems that are
similar to the original but smaller in size
Conquer the sub-problems by solving them
recursively. If they are small enough, just solve
them in a straightforward man

Elementary
Elementary Sorting
Sorting Algorithms
Algorithms
Comp 122, Spring 2004
Sorting Definitions
Input: n records, R1 Rn , from a file.
Each record Ri has
a key Ki
possibly other (satellite) information
The keys must have an ordering relation th

Binary
Binary Search
Search Trees
Trees
Comp 122, Spring 2004
Binary Trees
Recursive definition
1. An empty tree is a binary tree
2. A node with two child subtrees is a binary tree
3. Only what you get from 1 by a finite number of
applications of 2 is a

CUMULUX
WHAT IS CLOUD COMPUTING?
What does it mean to Enterprises? | Ranjith Ramakrishnan
CUMULUX: Cloud Computing Discovery Series
What is Cloud Computing?
What does it mean to Enterprises?
Table of Contents
What is Cloud Computing?. 1
What technologies

Todays puzzle
How far can you reach with a stack of n blocks,
each 2 units long?
ort - 1
d(n)
Comp 122
Lin / Devi
Todays puzzle
How far can you reach with a stack of n blocks,
each 2 units long?
ort - 2
d(n) = 1+ 1/2 + 1/3 + 1/4 + 1/5 + 1/6
1
1/2
1/3
n

Keys
Keys into
into Buckets:
Buckets:
Lower
Lower bounds,
bounds, Linear-time
Linear-time sort,
sort, &
& Hashing
Hashing
Comp 122, Spring 2004
Comparison-based Sorting
Comparison sort
Only comparison of pairs of elements may be used to gain
order infor

Algorithms for Text and Image Compression
Amar Mukherjee Holger Kruse Kunal Mukherjee
[email protected][email protected][email protected]
Department of Computer Science
University of Central Florida
Orlando, FL 32816
1 Introduction
The primary objective

Recurrences
Recurrences II.
II.
Comp 122, Spring 2004
The Master Method
Based on the Master theorem.
Cookbook approach for solving recurrences
of the form
T(n) = aT(n/b) + f(n)
a 1, b > 1 are constants.
f(n) is asymptotically positive.
n/b may not be

Minimum Spanning Trees
Problem:
Connect a set of nodes
by a network of minimal total
length
Some applications:
Communication networks
Circuit design
Layout of highway systems
Lin/Foskey/Manocha
Motivation: Minimum
Spanning Trees
To
minimize the length

Hash
Hash Tables
Tables 11
Comp 122, Spring 2004
Dictionary
Dictionary:
Dynamic-set data structure for storing items indexed
using keys.
Supports operations Insert, Search, and Delete.
Applications:
Symbol table of a compiler.
Memory-management tabl

What is an Algorithm?
(And how do we analyze one?)
COMP 122, Spring 04
Algorithms
Informally,
A tool for solving a well-specified computational
problem.
Input
Algorithm
Output
Example: sorting
tro - 2
input: A sequence of numbers.
output: An ordered pe

Heapsort
Heapsort
Comp 122, Spring 2004
Heapsort
Combines the better attributes of merge sort
and insertion sort.
Like merge sort, but unlike insertion sort, running
time is O(n lg n).
Like insertion sort, but unlike merge sort, sorts in
place.
Introd

Insertion Sort
review of loop invariants
Comp 122, Spring 2004
Insertion Sort
Problem: sort n numbers in A[1.n].
Input: n, numbers in A
Output: A in sorted order: i [2.n], A[i-1] <= A[i]
for
for j=2
j=2 to
to length(A)
length(A)
do
do key=A[j]
key=A[j

Order
Order Statistics
Statistics
Comp 122, Spring 2004
Order Statistic
ith order statistic: ith smallest element of a set of n
elements.
Minimum: first order statistic.
Maximum: nth order statistic.
Median: half-way point of the set.
der - 2
Unique,

Red-Black
Red-Black Trees
Trees
Comp 122, Spring 2004
Red-black trees: Overview
Red-black trees are a variation of binary search
trees to ensure that the tree is balanced.
Height is O(lg n), where n is the number of nodes.
Operations take O(lg n) time

Greedy
Greedy Algorithms
Algorithms
Comp 122, Spring 2004
Overview
Like dynamic programming, used to solve optimization
problems.
Problems exhibit optimal substructure (like DP).
Problems also exhibit the greedy-choice property.
eedy - 2
When we have

RAIK 283
Data Structures & Algorithms
0-1 Knapsack problem
1
RAIK 283
Data Structures & Algorithms
Giving credit where credit is due:
Most of slides for this lecture are based on slides
created by Dr. David Luebke, University of Virginia.
Some slides ar

Working with XML
Top Contents Index Glossary
Working with XML
The Java API for Xml Parsing (JAXP) Tutorial
by Eric Armstrong
[Version 1.1, Update 31 - 21 Aug 2001]
This tutorial covers the following topics:
Part I: Understanding XML and the Java XML APIs

Why C?
.) C
is simple
.) C
is fast
+ C is small
+ C offers better interaction wlth
hardware
Historical Development of C
1960 International Committee
Mach~neOriented
, Ex. Assembly,
KlClT I
C I Lecture 1
Ex. Basic, Fortran,
Pascal,Cobot
I
In The Beqinnina