CS311 ALGORITHMS
QUIZ 1 - Answer Key
1) (10 pts each) In each of the following functions, indicate whether f = O(g) or f
=(g) or both (in which case f = (g). P
Algorithms
Graph representa1on
Alterna1vely, we can use a linked list for each vertex.
Which one is be?er?
Exploring a graph
solid edges -> tree edges
dashed edge
Algorithms
Breadth-rst search
Proceed layer by layer to compute distances
from s to the other ver;ces.
Once we have picked out the nodes at
distance 0,1,2.d the ones
Algorithms
Hilal Kazan, Fall 2015
Master theorem
Proof
Lets assume that n is a power of b.
Size of the subproblems decreases by a factor
of b with each re
Copyright c Sanjoy Dasgupta
1
Note three: Strongly connected components
CSE 101
1 Dening connectivity for directed graphs
Connectivity in undirected graphs is pretty straightforward: a graph that is
Algorithms
Hilal Kazan, Fall 2015
Genera9ng random primes
Genera9ng random primes
Cryptography
Private-key schemes
Alice and Bob meet beforehand and secretly choose a
CS 311
ALGORITHMS HOMEWORK 1
(Deadline is 10th of November, beginning of lecture)
1) (25 pts) Problem 3.4 ii) from the book. Please show the pre and post numbers of
the nodes and explain the steps of