CS 1510
Greedy Homework Problems
1. (2 points) Consider the following problem:
INPUT: A set S = cfw_(xi , yi )|1 i n of intervals over the real line.
OUTPUT: A maximum cardinality subset S 0 of S such that no pair of intervals in S 0 overlap.
Consider the
CIS 5371 Cryptography
Home Assignment 2
Due: At the beginning of the class on February 18, 2014
Exercises taken from the course textbook. Jonathan Katz and Yehuda Lindell, Introduction to
Modern Cryptography.
2.5 Prove or refute: Every encryption scheme
Comparison between two approaches to solve the
knapsack problem
Abstract
We review two algorithms that can be used to solve the knapsack problem. Both the Greedy
Algorithm and Dynamic Programming approaches to knapsack problem are presented and
compared.
4.8
Huffman Codes
These lecture slides are supplied by Mathijs de Weerd
Data Compression
Q. Given a text that uses 32 symbols (26 different letters,
space, and some punctuation characters), how can we encode
this text in bits?
Q. Some symbols (e, t, a, o,
4.8
Huffman Codes
These lecture slides are supplied by Mathijs de Weerd
Data Compression
Q. Given a text that uses 32 symbols (26 different letters,
space, and some punctuation characters), how can we encode
this text in bits?
Q. Some symbols (e, t, a, o,
AOA(COT 5405)
(Spring 2016)
Instructor: Sanjay Ranka
Assignment 2
1. Oxen Pairing
Consider the following problem: We have n oxen, OX1, , OXn, each with a strength rating Si. We need to pair the oxen up
into teams to pull a plow; if OXi and OXj are in a te
COT5405 Homework 2 - spring 2016
Assigned: 02/16, Tue
Due: 02/23, Tue
There are five questions for homework 2.
1. Oxen Pairing
Consider the following problem: We have n oxen, OX1, , OXn, each with a strength
rating Si. We need to pair the oxen up into tea
Assignment 3
Due Mar 28
Question 1:
Consider the problem of neatly printing a paragraph with a monospaced font
(all characters having the same width) on a printer. The input text is a sequence
of n words of lengths l1 , l2 , ., ln , measured in characters
CSC 609: Cryptography
Midterm Solutions
1
March 19, 2014, 11:1512:05 PM
There are five problems each worth five points for a total of 25 points. Show
all your work, partial credit will be awarded. Space is provided on the test
for your work; if you use a
Paths in graphs
LECTURE 22
Shortest Paths I
Properties of shortest paths
Dijkstras algorithm
Correctness
Analysis
Breadth-first search
Prof. Alper ngr
Paths in graphs
Consider a digraph G = (V, E) with edge-weight
function w : E R. The weight of path
Computational geometry
COT5405 Analysis of Algorithms
LECTURE 28
Computational Geometry
Basic definitions
Orthogonal Search
1D/2D Range Trees
Line Segment Intersections
Sweep Line Algorithms
Computational geometry
Algorithms for solving geometric pro
Homework 2 solutions
1. Candidate Greedy Strategy I: Take the weakest two oxen, if together they meet the strength
requirement, make them a team. Recursively find the most teams among the remaining
oxen. Otherwise, delete the weakest ox. Recursively find
COT5405 Homework 2 -spring 2016
Assigned: 02/16, Tue
Due: 02/23, Tue
There are five questions for homework 2. Here are the first two questions, and remaining three
will be posted on 02/17 morning.
1. Oxen pairing
Consider the following problem: We have n
COT5405 exam 2 solution
1.
a)
TRUE
b)
FALSE
Consider the following input: I = [2, 1, 1] and L = 3,
GREEDY(I) =
21
k=0
1
k=2
max(k) = 2
OPT(I) =
2
k=1
11
k=1
max(k) = 1
c)
FALSE
This algorithm does not correctly solve the problem. Consider the following in
1. [20 points = 4+4+4+4+41 TRUE/FALSE Quns'rious (NO NEED son JUSTIFICATION)
(a)
(b)
(C)
(d)
(e)
TRUE/FALSE
Bellman-Ford algorithm presented in class for computing shorthest paths is a dynamic
programming algorithm.
FqbQ,
Tmm/ FALSE
Dijkstras algorithm de
Assignment 3 Solutions
March 29, 2016
Question 1:
Note: We assume that no word is longer than will fit into a line, i.e., li M
for all i. First, well make some definitions so that we can state the problem
more uniformly. Special cases about the last line
0/1 Knapsack problem: A Survey
B.M.N.V.Ogendra
UFID:96902254
mbattul1@ufl.edu
ABSTRACT
The survey purpose is to explain different algorithms designed to solve the 0/1
knapsack problem and analyse their complexities. The 0/1 knapsack problem is an
optimiza
TB Schardl
September 25, 2009
6.046J/18.410J
Recitation 3
Deterministic Select
Problem: Given an unsorted set of n elements, find the ith order statistic of that set (the ith
smallest element in the set.)
The obvious way to do this takes O(n log n) time.
CS 540
1.
Assignment 5
Solutions
Let R(A,B,C,D,E,G,H) be a relation schema with set of functional dependencies:
F = cfw_ABC, BD, CDE, CEGH, GA.
a.
Exhibit a derivation of ABE from F.
in F
Reason
-ABB
reflexivity rule
BD
in F
ABD
transitivity rule
ABC
in F
CS 1510 Midterm 1
Fall 2014
1. (40 points) You wish to drive from point A to point B along a highway minimizing the time
that you are stopped for gas. You are told beforehand the capacity C of your gas tank in liters,
your rate F of fuel consumption in li