Question 1:
Sometimes a program requires two stacks containing the same type of items. If the two stacks are
stored in two separate arrays, one stack might fill up while there is plenty of space in the other
stack. A very useful method to eliminate this problem, thus increasing efficiency, is to put both
stacks into the same array, and let one stack grow from one end of the array, while the other
grows from the other end, in the opposite direction, towards the first stack.
top of Stack1
top of Stack 2
a) Define a new structure called doublestack which includes an integer array and two
variables, top1 and top2.
b) Define the functions for doublestack operations (initialize_s1, is_empty_s1,
is_full_s1, push1, pop1, initialize_s2, is_empty_s2, is_full_s2,
push2, pop2).