subject

Consider the problem of storing n books on shelves in a library. the order of the books is fixed by the cataloging system and so cannot be rearraged. therefore, we can speak of a book bi , where 1 ≤ i ≤ n, that has a thickness ti and height hi . the length of each bookshelf at this library is l. (1) suppose all the books have the same height h (i. e. h = hi = hj for all i, j) and the shelves are all separated by a distance of greater than h, so any book fits on any shelf. the greedy algorithm would fill the first shelf with as many books as we can until we get the smallest i such that bi does not fit, and then repeat with subsequent shelves. show that the greedy algorithm always finds the optimal shelf placement, and analyze the time complexity. (2) this is a generalization of the previous problem. now consider the case where the height of the books is not constant, but we have the freedom to adjust the height of each shelf to that of the tallest book on the shelf. thus the cost of a particular layout is the sum of the heights of the largest book on each shelf. (a) give an example to show that the greedy algorithm of stuffing each shelf as full as possible does not always give the minimum overall height. (b) what technique should we use to solve this problem? (c) what are the subproblems? (d) how many subproblems are there? (e) give an algorithm for this problem, and analyze its time complexity

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
Awell-diversified portfolio needs about 20-25 stocks from different categories.
Answers: 2
question
Computers and Technology, 23.06.2019 12:40
According to the video what are some tasks petroleum engineers perform check all that apply
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
Of the following pieces of information in a document, for which would you most likely insert a mail merge field?
Answers: 3
question
Computers and Technology, 24.06.2019 07:00
Selective is defined as paying attention to messages that are consistent with one’s attitudes and beliefs and ignoring messages that are inconsistent.
Answers: 1
You know the right answer?
Consider the problem of storing n books on shelves in a library. the order of the books is fixed by...
Questions
question
History, 10.12.2019 11:31
question
Computers and Technology, 10.12.2019 11:31
Questions on the website: 13722367