1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

int

node*

IMAGE imgs/lec-2101.gif

top

Linked Stack showing effect of push() and pop() operations

The main program(stackmain.cc)

#include "Vstack.h"
#include "Linkstack.h"
#include "Arraystack.h"

extern void reverse( Gstack<int> &s, int n );

void main()
{
Array_stack
<int>s1(500);
Link_stack
<int>s2;

// but not s2();

reverse(s1, 20); reverse(s2, 20);

}

22-Mar-98

Page 5

C201/TAM