If stacks are implemented using a single array of size each growing from ceste en wat
be the condition to check flow so the memory can be utilized effectie
Answers
Answered by
0
Since the stacks are growing from opposite ends, initially top1=1 and top2=MAXSIZE. Now, to make the space usage most efficient we should allow one stack to use the maximum possible space as long as other stack doesn't need it. So, either of the stack can grow as long as there is space on the array and hence the condition must be top1=top2−1.
Similar questions