Write your ASU ID on all answer sheets and annular the sheets. ASU ID:
Submit this question :mper along with your answer sheets.
Name
CSE 591 Foundations of Algorithms*
Quiz 2, Spring 2016
Closed Books, Closed Notes
Time: 50 minutes
Each question carries

*CSE 591 Foundations of Algorithms*
Mid Term, Spring 2016
Closed Books, Closed Notes
Time: 50 minutes
Each question carries 10 pts.
Problem 1: Suppose there is a set A of men and a set B of women. Each set contain n
elements. There exist two n n arrays P

CSE 591 Foundations of Algorithms*
Quiz 1, Spring 2016
Closed Books, Closed Notes
Time: 50 minutes
Each question carries 10 pts.
Problem 1: Suppose there is a set A of men and a set B of women. Each set contain n
elements. There exist two n n arrays P and

*CSE 591 Foundations of Algorithms
Final, Spring16
Closed Books, Closed Notes
Time: 1 Hour and 50 Minutes
Answer any 5 questions, Each question carries 20 points
Problem 1: Using Dynamic Programming technique, construct an optimal binary search three for

1.
2.
3.
4.
5.
6.
7.
Given a sorted array in which all elements appear twice (one after one) and one
element appears only once. Find that element in O(log n) complexity.
Solution:
This is an application of divide and conquer technique.
The idea is to use

Several of the solutions below are taken from the website http:/www.geeksforgeeks.org/
1.
2.
Solution:
3.
4.
Maximum size square sub-matrix with all 1s
Given a binary matrix, find out the maximum size square sub-matrix with all 1s.
For example, consider t

CSE 551: Foundation of Algorithms
Homework 6 - Dynamic Programming
Prof. Andrea W. Richa
Due at 10.30 am, October 27, 2016
This is a 2-member group homework assignment. Each group is supposed to work on the problems below together, including the writeup o

Data structures
Static problems. Given an input, produce an output.
D ATA STRUCTURES
Ex. Sorting, FFT, edit distance, shortest paths, MST, max-flow, .
amortized analysis
Dynamic problems. Given a sequence of operations (given one at a time),
binomial he

CSE 551: Foundation of Algorithms
Homework 5 - Divide-and-Conquer
Prof. Andrea W. Richa
Due at the beginning of class on Tuesday, October 25, 2016
This is a 2-member group homework assignment. Each group is supposed to work on the problems below together,

Amortized Analysis
DistributeMoney(n, k)
1
2
3
Each of n people gets $1.
for i = 1to k
do Give a dollar to a random person
What is the maximum amount of money I can receive?
Amortized Analysis
DistributeMoney(n, k)
1
2
3
Each of n people gets $1.
for i =

CSE 551: Foundation of Algorithms
Homework 2 - Shortest Paths, MST
Prof. Andrea W. Richa
Due at the beginning of class on Spet 15, 2016
This is a 2-member group homework assignment. Each group is supposed
to work on the problems below (taken from the text

CSE 551: Foundation of Algorithms
Homework 1 - Stable Matching and Greedy
Prof. Andrea W. Richa
Due at the beginning of class (10:30am) on Tuesday, September 6, 2016
This is an individual homework assignment. Please submit neatly typed
solutions for the a

CSE 551: Design and Analysis of Algorithms
Homework 4 - Amortized Analysis, Splay Trees
Prof. Andrea W. Richa
Due at the beginning of class on 10:30am on Thursday, October 13 2016
This is a 2-member group homework assignment. Each group is supposed to wor

CSE 551: Foundation Of Algorithms
Homework 3 - Amortized Analysis
Prof. Andrea W. Richa
Due at 10:30am on Tue, Sep 27, 2016
This is a 2-member group homework assignment. The group members are
supposed to work on the problems below together, including the

CSE 551: Solutions for Homework 3
Prof. Andrea W. Richa
1. Answer:
Aggregate Method:
Pblog nc
Total cost T = i=0 (2i ) + (n blog nc 1)
blog nc
T
=
X
(2i ) + (n blog nc 1)
i=0
=
3n blog nc 2
=
O(n)
Hence the amortized cost is O(1).
Accounting Method:
Let t