Two stacks of positive integers are needed


Two stacks of positive integers are needed, both containing integers with values less than or equal to 1000. One stack contains even integers; the other contains odd integers. The total number of elements in the combined stacks is never more than 200 at any time, but we cannot predict how many are in each stack.(All of the elements could be in one stack, they could be evenly divided, both stacks could be empty, and so on.)Can you think of a way to implement both stacks in one array?
a. Draw a diagram of how the stacks might look
b. Write the definitions for such a double-stack structure.
c. Implement the push operation; it should store the new item into the correct stack according to its value(even or odd) 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Two stacks of positive integers are needed
Reference No:- TGS093528

Expected delivery within 24 Hours