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 15:00
Who is the first president to use social media as part of his campaign strategy
Answers: 1
question
Computers and Technology, 22.06.2019 17:00
Your computer running windows 10 is doing some very strange things with the operating system. you are fairly certain it is not a hardware issue. you need to try to get further insight into what is going on within the operating system. which tool would be best suited for this?
Answers: 2
question
Computers and Technology, 22.06.2019 17:30
1. before plugging in a new device to a computer you should unplug all other devices turn off the computer turn on the computer 2. many of the maintenance tools for a computer can be found in the control panel under administrative tools display personalization
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
What machine listens for http requests to come in to a website’s domain? a. a router b. a browser c. a server d. a uniform resource locator
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
Mathematics, 07.08.2019 16:10
question
Mathematics, 07.08.2019 16:10
question
Mathematics, 07.08.2019 16:10
question
Mathematics, 07.08.2019 16:10
question
Mathematics, 07.08.2019 17:10