Some Stack Question

1)How do you implement 2 stacks using only one array.Your stack routines should not indicate an overflow unless every slot in the array is used? **Solution:**given an Array,start the first stack S1 from left end and other stack S2 from the right end.while S1 gets grows towards right ,S2 grows towards left. (By the way we can implement n stacks in 1 array, eg. of 3 stacks in 1 array is given in question 3 below) [Read More]