Figure 4: The shared stack method. Using a predecessor array, you share an array amongst multiple stacks. Here, only two are shown. Stack pointers are used to maintain the top of each stack, and the predecessor array maintains the link to the predecessor, on each stack, of every item pushed onto the stacks.