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:00
How does a policy manual an organization? a. it boost productivity. b. it create awareness in employees about the organization’s values. c. it employees achieve targets. d. it safeguards the organization from liabilities.
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
To increase sales, robert sends out a newsletter to his customers each month, letting them know about new products and ways in which to use them. in order to protect his customers' privacy, he uses this field when addressing his e-mail. attach bcc forward to
Answers: 2
question
Computers and Technology, 22.06.2019 23:30
What is the digital revolution and how did it change society? what are the benefits of digital media?
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
When early motion pictures played in movie theaters, they were often accompanied by live organ or piano music. which of the following are the most likely reasons that this happened? (select all that apply). the music was provided to distract audience members from the loud sounds made when filmstrips were changed. the music accompanied the movies because the movies were silent and audiences were used to hearing music during plays in theaters. the music usually was played before, and sometimes after the movie, as an alternative form of entertainment. the music viewers to interpret the dramatic action in the films.
Answers: 2
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
Mathematics, 25.05.2020 08:57
question
Mathematics, 25.05.2020 08:57
question
Mathematics, 25.05.2020 08:57
Questions on the website: 13722363