[prev] [index] [next]

Structured ADTs (cont)

Interface of a typical structured ADT:

typedef StackRep *Stack;

Stack newStack();
void  freeStack(Stack s);
void  push(Stack s, Item it);
Item  pop(Stack s);
int   height(Stack s);

Clients see only a pointer; representation is hidden.