Representing two stacks in an array

Stacks

Representing two stacks in an array

One array may be considered to be composed of multiple stacks, such that the size of the array is divided by the number of stacks to be created, which results in representing multiple stacks in one array.

For example:  If we wish to represent two stacks in one array of size 10, then the size of the array (10) may be divided by 2, to result in two stacks each of size 5.

Thus, when you push or pop an element, you must also state the stack id, along with other required information.