data[data.Length - count2] = v;
throw new ApplicationException("Stack1 underflow");
throw new ApplicationException("Stack2 underflow");
int v = data[data.Length - count2];
private void AssertNotFull()
if (count1 + count2 >= data.Length)
throw new ApplicationException("Container is full");
public static void Main(string[] args)
TwoStacks s = new TwoStacks(5);
private static void TestPush(TwoStacks s, int index, int v)
Console.WriteLine("Push{0}({1})", index, v);
private static void TestPop(TwoStacks s, int index)
Console.WriteLine("Pop{0} = {1}", index, v);