This preview shows page 1. Sign up to view the full content.
Fall 11: CSci 5421—Advanced Algorithms and Data Structures
Out 10/12
Homework 3
Due 10/31
Please do all problems; we will grade a subset of three to four problems. Any Exercise/Problem
numbers refer to the 3rd edition
of the text. (Corresponding numbers for the second edition are
given, where available, in parentheses.) Please follow all of the instructions given in the handout
for Homework 1.
1.
(12 points) Suppose that in the 0/1knapsack problem, the order of the items if sorted by
increasing weight (i.e.,
w
i
’s) is the same as when they are sorted by decreasing value (i.e.,
v
i
’s).
Assume that you are given an unsorted set of items. Describe, in words, an
O
(
n
log
n
)time greedy
algorithm to compute a subset of items of maximum value whose total weight is at most the
knapsack capacity (i.e.,
W
).
Use the twostep proof method and establish the greedy choice property and optimal substructure.
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 01/28/2012 for the course CSCI 5421 taught by Professor Sturtivant,c during the Fall '08 term at Minnesota.
 Fall '08
 Sturtivant,C
 Algorithms, Data Structures

Click to edit the document details