questiontwo stacks of positive integers are


Question

Two stacks of positive integers are required, both containing integers with values less than or equal to 1000. One stack contains even integers; other contains odd integers. The total number of elements in the combined stacks is never more than 200 at any time, but we cannot guess how many are in each stack. (All of the elements could be in one stack, they could be evenly divided, and both stacks could be empty, and so on.) Can you think of a way to implement both stacks in 1 array?

a. describe a diagram of how the stacks might look

b. write down the definitions for such a double-stack structure.

c. execute 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!!
Computer Engineering: questiontwo stacks of positive integers are
Reference No:- TGS0444646

Expected delivery within 24 Hours