Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop your own algorithm and implement the C code for the following problem and compare single and multi threaded program performances:You have a set of

Develop your own algorithm and implement the C code for the following problem and compare single and multi threaded program performances:You have a set of n books with weights w
1
,
w
2
,
,
wn
(
in grams
)
.
You must pack them into k boxes. The capacity of each of these boxes
(
in kilograms
)
is c
1
,
c
2
,
,
ck
.
Our goal is to pack all of the n books in the k boxes without exceeding the capacity of any of the boxes. Rules:Draw flow chart of your single thread algorithm by handUser will input n and k valuesc and w values will be generated randomlyYou will check user input and randomly generated data integrity, no book can be larger than boxes, no box can carry all books.You will calculate wasted storage capacitiy in gramsYou will calculate how many boxes used out of k boxesYou will calculate efficiency of algorithm by
(
wasted
_
storage
)
*
(
#used
_
boxes
/
k
)
Clearly display the result

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

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions