Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with part B. Please write in Pseudocode C++ Greedy strategy Does using the greedy algorithm for making change of n cents give

image text in transcribed

I need help with part B. Please write in Pseudocode C++

Greedy strategy Does using the greedy algorithm for making change of n cents give a correct solution if a nickel was worth 6 cents instead of 5? (we have 1, 6, 10 and 25 cent coin a. b. We have n unique items. Fori 1,2,3 . .n, each item has a weight w,>0 and value vi> 0. Write a greedy algorithm to find the maximum value of items that can be carried in a knapsack with a maximum weight capacity of W. An item may be broken into pieces and only a fraction put into the knapsack. It should take an array of weights, an array of item values and the weight limit of the knapsack as input. The array of weights and items are ordered such that w, corresponds to the same item as vi

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

2. Discuss the steps in preparing a manager to go overseas.

Answered: 1 week ago

Question

8. Measure the effectiveness of the succession planning process.

Answered: 1 week ago