COSC 3101: Design and Analysis of Algorithms
Assignment 3 - solutions
Problems:
1. A certain string processing language allows the programmer to break a string into two pieces. Since
this involves cop
CSE 3101: Design and Analysis of Algorithms
Assignment 4 - solutions
Note: This document provides solution sketches. It omits some details (e.g. showing that the Master
Theorem is applicable) that you
CSE 3101: Design and Analysis of Algorithms
Assignment 5b Solutions
Harder problems on Dynamic Programming
Note: This document provides solution sketches. It omits some details (e.g. some correctness
CSE 3101 test 5
Summer 2010
July 20, 2010
Instructor: S. Datta
1. (10 points) A subsequence is a palindrome if it is the same whether read left to right or right to left. In this
problem, you are requ
COSC 3101: Design and Analysis of Algorithms
Assignment 3 (Released July 1, 2004)
Due date: July 16, 2004
Notes:
Feel free to refer to, and use any facts from the textbook.
In this course, assignmen
CSE 3101: Design and Analysis of Algorithms
Assignment on greedy algorithms - solutions
Note: This document provides solution sketches. It omits some details (e.g. some correctness proofs) that
you mu
CSE 3101: Design and Analysis of Algorithms
Assignment on graph algorithms - 2
1. The Strongly-connected-components (SCC) algorithm in the book uses two DFS calls and a graph
transposition. Here is an
CSE 3101: Design and Analysis of Algorithms
Assignment on graph algorithms - solutions
Note: This document provides solution sketches. It omits some details (e.g. some correctness proofs) that
you mus
CSE 3101: Design and Analysis of Algorithms
Assignment on DP part 1 - solutions
Note: This document provides solution sketches. It omits some details (e.g. some correctness proofs) that
you must suppl
CSE 3101: Design and Analysis of Algorithms
Assignment 1
Problems:
1. (5 points) Prove that the following algorithm for exponentiation is correct.
power(y, z )
1 / return y z where y R, z N
2 x1
3 whi
CSE 3101 test 1
Summer 2010
May 18, 2010
Instructor: S. Datta
1. (5 points) Show that for every real constant a where a > 0,
(n + a)2 = (n2 ).
Hint: One way to prove () is to prove O() and () separate
CSE 3101 test 2
Summer 2010
June 1, 2010
Instructor: S. Datta
1. (3 points) Prove or provide a counterexample. If f (n) = (g (n) then 2f (n) = (2g(n) ).
Solution: A counterexample is f (n) = n, g (n)
CSE 3101: Design and Analysis of Algorithms
Assignment 3 - solutions
Problems:
1. Compute the exact sum
n
n
(i j )2
i=1 j =1
Solution: One way to do this is to expand the expression. So
n
n
n
(i j )2
COSC 3101A Midterm Exam part II
Summer 2003
June 11, 2003
Instructor: S. Datta
Name (LAST, FIRST):
Student number:
Instructions:
1. If you have not done so, put away all books, papers, cell phones and
COSC 3101 Midterm Exam
Summer 2004
June 11, 2004
Instructors: S. Datta, T. Ji
Name (LAST, FIRST):
Student number:
Instructions:
1. If you have not done so, put away all books, papers, cell phones and
COSC 3101A Final Exam
Summer 2003
August 11, 2003
Instructor: S. Datta
Name (LAST, FIRST):
Student number:
Instructions:
1. If you have not done so, put away all books, papers, cell phones and pagers.
COSC 3101B: Design and Analysis of Algorithms
Exercise 4
Note: These questions are straightforward and I am really pressed for time. So I have provided hints
rather than solutions.
1. Draw a decision
COSC 3101A: Design and Analysis of Algorithms
Exercise 3 solutions
Problems: For each of the following, answer yes or no, AND give VERY brief reasons/intuitions for
your answer.
1. For what constants
COSC 3101B: Design and Analysis of Algorithms
Exercise 2 solutions
Problems: For each of the following, answer yes or no, AND give VERY brief reasons/intuitions for
your answer.
1. Suppose
n
k 3 = (f
COSC 3101B: Design and Analysis of Algorithms
Exercise 1
Notes:
This is a 5-minute exercise.
Do not write proofs for any of your answers.
Problems: For each of the following, answer yes or no, and g
COSC 3101A: Design and Analysis of Algorithms
Assignment 2 (Released May 28, 2003)
Due date: June 9, in class
Notes:
Feel free to refer to, and use any facts from the textbook.
In this course, assig
COSC 3101A: Design and Analysis of Algorithms
Assignment 1 (Released May 12, 2004)
Due date: May 26, 4pm
Notes:
Feel free to refer to, and use any facts from, Section 3.2 in the book.
In this course
COSC 3101A Midterm Exam part I
Summer 2003
June 9, 2003
Instructor: S. Datta
Name (LAST, FIRST):
Student number:
Instructions:
1. If you have not done so, put away all books, papers, cell phones and p
COSC 3101A Final Exam
Summer 2003
August 11, 2003
Instructor: S. Datta
Name (LAST, FIRST):
Student number:
Instructions:
1. If you have not done so, put away all books, papers, cell phones and pagers.
COSC 3101A Midterm Exam part II
Summer 2003
June 11, 2003
Instructor: S. Datta
Name (LAST, FIRST):
Student number:
Instructions:
1. If you have not done so, put away all books, papers, cell phones and
COSC 3101A Midterm Exam part I
Summer 2003
June 9, 2003
Instructor: S. Datta
Name (LAST, FIRST):
Student number:
Instructions:
1. If you have not done so, put away all books, papers, cell phones and p
COSC 3101B Midterm Exam Solutions
Note: I have skipped the steps needed to check that the Master Theorem can be applied. You are required
to write those steps in the exam.
1. (12 points) Warm-up quest
COSC 3101A: Design and Analysis of Algorithms
Exercise 3 solutions
Problems: For each of the following, answer yes or no, AND give VERY brief reasons/intuitions for
your answer.
1. Given the recurrenc
COSC 3101B: Design and Analysis of Algorithms
Exercise 2 solutions
Problems: For each of the following, answer yes or no, AND give VERY brief reasons/intuitions for
your answer.
1. Suppose
n
k 3 = (f
COSC 3101B: Design and Analysis of Algorithms
Exercise 1
Notes:
This is a 5-minute exercise.
Do not write proofs for any of your answers.
Problems: For each of the following, answer yes or no, AND g