Question: 6) In class we wrote an algorithm to insert and delete items from multiple linear stacks occupying physical locations Lo+ 1 through M. First write
6) In class we wrote an algorithm to insert and delete items from multiple linear stacks occupying physical locations Lo+ 1 through M. First write (derive) the algorithm to insert in a random stack J detecting and reporting overflow. Second clearly explain why your algorithm detects overflow out of the last stack without having to treat it as a special case. The diagram below shows 3 stacks. 10 M Lo - 4 Bob Tom Sue Base[1]-0 Base[2]-5 Top[2) 5 Top[3]-9 Base(41-10 Top[1]-3 When queues overflow, memory is repacked to allow continued operation. Do not write the algorithms to calculate new bases or the repacking operation when a stack overflows. 6) In class we wrote an algorithm to insert and delete items from multiple linear stacks occupying physical locations Lo+ 1 through M. First write (derive) the algorithm to insert in a random stack J detecting and reporting overflow. Second clearly explain why your algorithm detects overflow out of the last stack without having to treat it as a special case. The diagram below shows 3 stacks. 10 M Lo - 4 Bob Tom Sue Base[1]-0 Base[2]-5 Top[2) 5 Top[3]-9 Base(41-10 Top[1]-3 When queues overflow, memory is repacked to allow continued operation. Do not write the algorithms to calculate new bases or the repacking operation when a stack overflows
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
