Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please explain each part of the pseudo code Input: W , Wi , vi , N W r = W , v T T =

Please explain each part of the pseudo code
Input: W, Wi, vi, N
Wr=W,vTT=0,xi=0
' is the remaing volume
VTT is the total value
xi is the item selection decision
calculate ri=viwi values for all items
sort ris vulues in non-iwcreasing order.
let I be the sorted item indices
for ;inI
if wrwi
xi=1
wr=wr-wi
vT=vT+vi
else if wr>0
xi=wrwi
wr=0
vTT=vTT+xi*vi
utput: xiin[0,1],vT
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 19th International Conference Dexa 2008 Turin Italy September 2008 Proceedings Lncs 5181

Authors: Sourav S. Bhowmick ,Josef Kung ,Roland Wagner

2008th Edition

3540856536, 978-3540856535

More Books

Students also viewed these Databases questions

Question

a. When did your ancestors come to the United States?

Answered: 1 week ago

Question

d. What language(s) did they speak?

Answered: 1 week ago

Question

e. What difficulties did they encounter?

Answered: 1 week ago