Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Details Given a set of n objects of sizes s 0 , s 1 , dots, s n - 1 , each satisfying n 0

Details
Given a set of n objects of sizes s0,s1,dots,sn-1, each satisfying n0,1,dots,k-1k0, and an unlimited supply of bins of capacity 1, pack all n objects into bins such that the total size of the objects in each bin does not exceed 1 and the number of bins is minimized.
Consider the following greedy algorithm: Assume you have already placed objects 0,1,dots,k-1. Place object kin a bin that has the maximum amount of available space. Ifno such bin exists, place the object in a new bin.
Describe how to efficiently implement this algorithm using a binary heap.
Analyze the runtime of this algorithm.
Show that this greedy algorithm does not always return the optimal solution.
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

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions