[prev] [index] [next]

Structured ADTs (cont)

Implementation of a typical structured ADT:

// what a single item looks like
typedef struct stackNode {
	Item value;
	struct stackNode *next;
} StackNode;

// representation of Stack
typedef struct {
	StackNode *top;
	int height;
} StackRep;

// implementation of functions ...