CS/ECE 374
Lab 9 Solutions October 19
Fall 2016
Recall the class scheduling problem described in lecture on Tuesday. We are given two arrays S[1 . n]
and F [1 . n], where S[i] < F [i] for each i , representing the start and finish times of n classes. Your
1. Recurrences: 12 points
Give a tight asymptotic bound for the following recurrences. No justication necessary.
A(n) = 2A( n) + 1 for n > 9 and A(n) = 1 for 1 n 9.
(log n)
Recursion tree is a binary tree with depth log log n and work is 1 at each node s
CS 374 Fall 2014 Homework 4
Due Tuesday, October 7, 2014 at noon
1. For this problem, a subtree of a binary tree means any connected subgraph. A binary tree is complete
if every internal node has two children, and every leaf has exactly the same depth. De
NEW CS 473: Theory II, Fall 2015
Midterm September 29, 2015, 56:50 PM
Location: Siebel 1404
1. The Game of Rat and Column.
1
(25 pts.)
[A similar but harder reduction had been shown in class.]
For the following decision problem, prove that it is NPC. A bi
CS473 Spring 2014
Discussion 12
April 22/23, 2014
1. From Set Cover to Montone SAT
Consider an instance of a CNF formula specied by clauses C1 , C2 , . . . , Ck over a set
of boolean variables x1 , x2 , . . . , xn . We say is monotone if each term in each
CS 473: Fundamental Algorithms, Spring 2013
Discussion 11
April 17, 2013
11.1.
Building 3CNF formulas.
(A) Consider the following boolean function f and g dened by a truth table. Generate a
3CNF formulas that computes these two functions.
x
z
f (x, y, z)
NEW CS 473: Theory II, Fall 2015
Midterm September 29, 2015, 56:50 PM
Location: Siebel 1404
1. The Game of Rat and Column.
1
(25 pts.)
[A similar but harder reduction had been shown in class.]
For the following decision problem, prove that it is NPC. A bi
CS 374
Homework 4 solutions
Fall 2014
1. For this problem, a subtree of a binary tree means any connected subgraph. A binary tree is complete if
every internal node has two children, and every leaf has exactly the same depth. Describe and analyze a
recurs
CS 473: Fundamental Algorithms, Spring 2013
Midterm 1: Conict Exam
Instructions:
(A) This is a closed book exam. No notes, books, calculators, cellphones, etc. are allowed.
(B) Graduate student: Answer all questions on the exam.
(C) Undergraduate student:
CS 473: Fundamental Algorithms, Spring 2013
a
Discussion 9
6/10
b
9/13
2/4
5/8
March 27, 2013
9.1.
4/4
Go With the Flow.
The gure on the right shows a ow network
along with a ow. In the gure, the notation
/ for an edge means that the ow on the
edge is and
CS 473: Algorithms, Fall 2010 HW 5 (due Tuesday, October 12)
This homework contains four problems. Read the instructions for submitting homework on the course webpage. In particular, make sure that you write the solutions for the problems on separate shee
CS/ECE 374
Lab 9 October 19
Fall 2016
Recall the class scheduling problem described in lecture on Tuesday. We are given two arrays
S[1 . n] and F [1 . n], where S[i] < F [i] for each i, representing the start and finish times of n
classes. Your goal is to
The point is, ladies and gentleman, greed is good. Greed works, greed is right.
Greed claries, cuts through, and captures the essence of the evolutionary spirit.
Greed in all its forms, greed for life, money, love, knowledge
has marked the upward surge in
CS 374 Fall 2014 Homework 8
Due Tuesday, November 4, 2014 at noon
1. After a grueling algorithms midterm, you decide to take the bus home. Since you planned ahead,
you have a schedule that lists the times and locations of every stop of every bus in Champa
CS 473: Algorithms, Spring 2012
Final Exam: May 7, 2012
Instructions:
This is a closed book exam. No notes, books, calculators, etc. are allowed.
Answer Problems 1,2,3 and any four of Problems 4,5,6,7,8. Read all questions before
deciding which ones to
CS 473
1.
Homework 5 Solutions
Spring 2016
(a) Prove that the item returned by GetOneSample(S) is chosen uniformly at random from S .
Solution: Let P(i, n) denote the probability that GetOneSample(S) returns the ith
item in a given stream S of length n. W
CS 473: Algorithms, Spring 2012
Midterm 1: February 23, 2012
Instructions:
This is a closed book exam. No notes, books, calculators, etc. are allowed.
Answer all problems. You can write I Dont Know for a problem (or its sub-parts) to
get 25% credit for
CS 473
Homework 10 Solutions
Spring 2010
1. Show that 2SAT is NP-hard, or describe a polynomial-time algorithm to solve it.
Solution: We describe a polynomial-time algorithm to solve 2SAT. Given a 2CNF boolean formula , the implication graph G is dened as
CS 473: Fundamental Algorithms, Spring 2013
Conict Final Exam: 7pm-10pm, May 6, 2013
1. Multiple choice. (8 pts.)
For each of the questions below choose the most appropriate answer.
(A) Given a ow f on a network G with costs on the edges, there is a linea
CS 473: Algorithms, Fall 2010 HW 1 (due Tuesday, September 7th)
This homework contains four problems. Read the instructions for submitting homework on the course webpage. In particular, make sure that you write the solutions for the problems on separate s
CS 473
Homework 6 Solutions
Fall 2013
1. Describe data structures that support Lookup in O(1) worst-case time and the other two operations in the
following time bounds.
(a) The worst-case time for both BLACKEN and NEXTWHITE is O(log n).
Solution (balanced
CS 374 Fall 2014 Homework 7
Due Tuesday, October 28, 2014 at noon
1. You are standing next to a water pond, and you have three empty jars. Each jar holds a positive
integer number of gallons; the capacities of the three jars may or may not be different. Y
Algorithms
Lecture 9: Randomized Algorithms [Fa'10]
The first nuts and bolts appeared in the middle 1400's. The bolts were just screws with straight sides and a blunt end. The nuts were hand-made, and very crude. When a match was found between a nut and a
CS 473
Homework 2 Solutions
Spring 2014
1. Kris is a professional rock climber who is competing in the U.S. climbing nationals. The competition requires
him to complete the following task: He is given a set of n holds that he might use to create a route w
CS 473: Fundamental Algorithms, Spring 2011
HW 4
Homework is due by Monday, 23:59:59, February 21 Problem 1 is due by Sunday, 23:59:59, February 20 This homework contains four problems. Read the instructions for submitting homework on the course webpage.
CS 473: Fundamental Algorithms, Spring 2013
Midterm 1: February 19, 2013
12:30-13:45 section in Everit Lab 151
14:00-15:15 section in Loomis 151
Instructions:
(A) This is a closed book exam. No notes, books, calculators, cellphones, etc. are allowed.
(B)
CS 473
Homework 4 (due March 2, 2010)
Spring 2010
1. Suppose we want to write an efcient function SHUFFLE(n) that returns a permutation of the set cfw_1, 2, . . . , n chosen uniformly at random. (a) Prove that the following algorithm is not correct. [Hint