CS 124
Lecture 22
Spring 2011
Suffix trees are an old data structure that have become new again, thanks to a recent new linear time algorithm
for constructing suffix trees due to Ukkonen that proves m
Lecture 10
CS124
Spring 2011
10.1 The Birthday Paradox
How many people do there need to be in a room before with probability greater than 1/2 some two of them have the
same birthday? (Assume birthdays
Lecture 7
CS124
In todays lecture we will be looking a bit more closely at the Greedy approach to designing algorithms. As we
will see, sometimes it works, and sometimes even when it doesnt, it can pr
CS124
Lecture 5
Spring 2011
Minimum Spanning Trees
A tree is an undirected graph which is connected and acyclic. It is easy to show that if graph G(V, E) that
satisfies any two of the following proper
CS124
Lecture 6
Spring 2011
Disjoint set (Union-Find)
For Kruskals algorithm for the minimum spanning tree problem, we found that we needed a data structure for
maintaining a collection of disjoint se
Tossing a Biased Coin
Michael Mitzenmacher
When we talk about a coin toss, we think of it as unbiased: with probability one-half it comes up heads,
and with probability one-half it comes up tails. An
Unbiasing Random Bits
Michael Mitzenmacher
1. Introduction
Most computers use a pseudo-random number generator in order to mimic
random numbers. While such pseudo-random numbers are sufficient for
man
CS124
Lecture 3
Spring 2011
Graphs and modeling
Formulating a simple, precise specification of a computational problem is often a prerequisite to writing a
computer program for solving the problem. Ma
CS124
Lecture 4
Spring 2011
Breadth-First Search
A searching technique with different properties than DFS is Breadth-First Search (BFS). While DFS used an
implicit stack, BFS uses an explicit queue st
Lecture 2
CS 124
In order to discuss algorithms effectively, we need to start with a basic set of tools. Here, we explain these tools
and provide a few examples. Rather than spend time honing our use
CS 124
Course Notes 1
Spring 2011
An algorithm is a recipe or a well-defined procedure for performing a calculation, or in general, for transforming
some input into a desired output. Perhaps the most
CS124
Lecture 8
Spring 2011
Divide and Conquer
We have seen one general paradigm for finding algorithms: the greedy approach. We now consider another
general paradigm, known as divide and conquer.
We
Lecture 11
CS 124
11.1 Applications: Fingerprinting for pattern matching
Suppose we are trying to find a pattern string P in a long document D. How can we do it quickly and efficiently?
Hash the patte
Lecture 12
CS124
12.1 Near duplicate documents1
Suppose we are designing a major search engine. We would like to avoid answering user queries with multiple
copies of the same page. That is, there may
CS 124
Lecture 21
We now consider a natural problem that arises in many applications, particularly in conjunction with suffix
trees, which we will study later. Suppose we have a rooted tree T with n n
Lecture 20
CS124
Heuristics can be useful in practice, but sometimes we would like to have guarantees. Approximation algorithms
give guarantees. It is worth keeping in mind that sometimes approximatio
CS124
NP-Completeness Review
Where We Are Headed
Up to this point, we have generally assumed that if we were given a problem, we could find a way to solve
it. Unfortunately, as most of you know, there
CS124
Lecture 19
We have defined the class of NP-complete problems, which have the property that if there is a polynomial time
algorithm for any one of these problems, there is a polynomial time algor
CS124
Lecture 17
Network Flows
Suppose that we are given the network in top of Figure 17.1, where the numbers indicate capacities, that is, the
amount of flow that can go through the edge in unit time
Lecture 16
16-10
max-flow problem as well that improve on this running time.
To summarize: the max-flow problem can be easily reduced to linear programming and solved by simplex. But
it is easier to u
CS124
15.1
Lecture 15
2SAT
We begin by showing yet another possible way to solve the 2SAT problem. Recall that the input to 2SAT is a logical
expression that is the conjunction (AND) of a set of claus
Lecture 13
CS124
Hopefully the ideas we saw in our hashing problems have convinced you that randomness is a useful tool in
the design and analysis of algorithms. Just to make sure, we will consider se
CS124
Lecture 9
Spring 2010
9.1 The String reconstruction problem
The greedy approach doesnt always work, as we have seen. It lacks flexibility; if at some point, it makes a wrong
choice, it becomes s
Lecture 14
14-6
Multiplying both sides by 11 , 21 , . . . , (p 1)1 we have
1 = a p1 mod p.
This proves Claim 5.
We now return to the end of Claim 4, where we must prove
x1+k(p1)(q1) = x mod n.
We firs
Graph Theory and Algorithms
M. Ashraf Iqbal
ii
Copyright c 2010 by M Ashraf Iqbal
All rights reserved.
ISBN . . .
. . . Publications
To my grand daughter Nariman
iv
Contents
1 Introduction
1
1.1
Why a
University of Central Punjab
(Incorporated by Ordinance No. XXIV of 2002 promulgated by Government of the Punjab)
FACULTY OF INFORMATION TECHNOLOGY
Operating System
Lab No 2
Overview of Ubuntu Directo
CSCI E-124Spring, 2017
Homework 1
Out: January 24, 2017
Due: Feb. 5, 2017
Homework will be due by 5 pm on the date due. Try to make your answers as clear and concise as
possible; style will count in y
CS124Spring, 2016
Homework 6
Out: March 31, 2017
Due: April 9, 2017 (4:59pm)
1. We have considered a random walk with a completely reflecting boundary at 0 that is, whenever position 0
is reached, wit
CS124Spring, 2017
Homework 7
Out: April 10, 2017
Due: April 23, 2017 (4:59pm)
1. If we restrict the problems we look at, sometimes hard problems like counting the number of independent sets
are in a g
Algorithms
Lecture 2
by Sarfraz
Graphs Representations
Draw the two Graphs ?
Comparison of Two Graphs
Representations
Reachability Problems
Reachability Problems
Reachability Problems
we need to confi
Decomposition of Graphs:
Representing Graphs
Daniel Kane
Department of Computer Science and Engineering
University of California, San Diego
Graph Algorithms
Data Structures and Algorithms
Learning Obj
Decomposition of Graphs:
Graph Basics
Daniel Kane
Department of Computer Science and Engineering
University of California, San Diego
Graph Algorithms
Data Structures and Algorithms
Learning Objectives
ADATA Premier SP580 SSD
If you want to give your notebook PC an SSD upgrade instead of going for a slower and less reliable
mechanical HDD, ADATA now offers a truly affordable solution. The Premier SP
Course: Intro to Game Design
Instructor : Muhammad Shibli Mansuri
Assignment : 2
Title : Game Analysis I
Due Date: Monday , 30th October , 2017
Objective
This is a one week assignment. Due in class on