Why in the book allocation problem,when we chose a pivot point we consider a[left]*a[pivot]*a[right].
Instead of that,we should conisder a[pivot-1]*a[pivot]*a[pivot+1] as pivot -1 and pivot +1 are the immediated left and right indices of pivot and we are given in the question to multiply with the immediate left and right cost.
Secondly,when we sold the pivot,the left for the right array and the right for the left array was still pivot.How is it possible.That was already sold so it should be removed from the shelf and right for the left array should be pivot +1 and left for the right array should be pivot -1 instead.
Please explain
Problem in explaination of book allocation
Hi Rohan, that’s a genuine doubt!
actually the pivot book is sold at last (among books from left to right),
I hope this observation clears all doubts.