Sometimes an application program requires two stacks for solving a problem. If the two
stacks are implemented by using two separate arrays, then one stack might overflow while
there was considerable unused space in the other. A more efficient way to avoid this
problem is to put all space in one array and let one stack grow from one end of the array
and the other stack start at the other end and grow in the opposite direction, as shown in Fig
1. In this way, if one stack turns out to be large and the other small, then they will still both fit
and there will be no overflow until all the space is actually used.