Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A thief breaks into a store and wants to fill his knapsack of capacity K with goods of as much value as possible. The thief's

A thief breaks into a store and wants to fill his knapsack of capacity K with goods of as much value as possible. The thief's knapsack can hold 100gms and has to choose from: 30gms of gold dust at Rs 1000gm
60gms of silver dust at Rs 500gm
30gms of platinum dust at Rs 1500gm
20gms of copper dust at Rs 400gm
25gms of bronze dust at 250gm
a) Design a greedy algorithm that finds the optimal solution for the given problem.
b) what is the maximum possible solution to get more profit?
c) Analyze the algorithm by finding time and space complexity for n number of items.
give pseudo code for (a) bit and please do not use chatgpt. pledo solution on paper

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 Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions