Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

Representing two stacks in an array

Representing two stacks in an array

October 2, 2012 Comments Off on Representing two stacks in an array By admin

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.

Comments are closed
x Close

Like Us On Facebook

You cannot copy content of this page.