CIS 320
Homework Assignment 1
Due: September 21st
1. Compare the two functions - log2 n and
answer.
n and decide their asymptotic relationship. Prove your
2. For each of the following statements, eith
CIS 320
Homework Assignment 3
Due: October 26 th
1. Suppose we want to maintain a splay tree for a set of elements S. In addition to the usual operations
of insert, delete, and find, we want to suppor
CIS 320
Homework Assignment 2
Due: October 5 th
1. An inversion in an array A is a pair of indices i < j such that A[i] > A[j]. Show how you can modify
MergeSort to find the number of inversions in a
CIS 320 OH Topics
1. A comprehensive review of all of the necessary runtimes for each of the data
structures (whether or not each runtime is expected or not, random or not,
deterministic or not, linea
Lecture 7 notes
'I. HAMHTONIAN PATH SATISFIAHHJTV
o HAMIIJTIONIAN PATH
Input
>:=: Graph G = 1: t'", E}
YeslflVe Question
>:=: Does there exist a Hamiltonian lath [a path that visits each node exa
Lecture ll]I
Dynamic Programming
Shortest Taths, Chained hrlatrix \lultiplieaticm
All Pairs Shortest Path Problem
Tnput: Edge 1Weighted Graph G (VJ-7.; weight Funeti on we) on each edge
Task: Comp
Midterm 1
Cheat Sheet
Logarithm/Exponent Rules
- 10gi(xy)= lost 36+ lost... .v
Note: The rule does not. apply to loga (x + y). A way to bound loge (x + y) would be to use
the following relationship
FS & DFS runtime- O(V+E) Breadth employs a queue to ensure that all neighbors of node v are
looked at before neighbors of neighbors of v. Depth simply calls depth on each neighbor first.
DFS Edge type
Greedy Algorithms1. Cast the optimization problem as one where we make a choice and are left with a
subproblem
2. Prove there is an optimal solution to the original solution that makes a greedy choice
Relaxation- if the distance to v is greater than the distance to u + w(u,v) then update distance to
v through u.
Bellman-Ford algorithm to find single-source shortest paths in a graph w/ negative weig
Dynamic Programming
Conditions: 1.Optimal substructure 2. Overlapping subproblems(repeated subproblems solved
with memorization).
How to solve DP problem1. Parameterizing the problem(recurrence)
2. Ba
Internship at Royal Solutions/Blue Square Concepts
-Territory management
-Training
-Business trips
-Since management is the end goal, they want us to be part of
everything of the process
-Leaders meet
CIS 320: Algorithms - Fall 2016
Proving lower bounds
For any computational problem there are many different (often infinitely many) algorithms that
solve the problem. To prove an upper bound of f (n)