You want to place n items on the bookshelf in such way that on the top shelf you have only one item and the number of items double on each consecutive shelf, see below. Justify using the definition of the floor function that it enough to have ⌊log2 n⌋ + 1 of the shelves to place all n items. Consider n = 1,2,3,4,...
X
XX
XXXX
XXXXXXXX
................
Hint: Assume that the number of shelves is l. Provide the formula for the maximum number of items and minimum number of items that can be placed on the lth shelf when the remaining l − 1 shelves are already filled.
Well i have explained everything in the pictures i have uploaded if u still feel any difficulty feel free to ask
please like my answer it matters a lot for me
Get Answers For Free
Most questions answered within 1 hours.