Lecture Objectives for Stack Lecture


At the end of today's class you should

KNOW:

BE ABLE TO:

Sample Exam Question:

Implement a function that satisfies the following pre- and post-conditions. You may assume that struct listNode is defined as

struct listNode{
   int data;
   struct listNode *next;
};


// PRE:  top is a pointer to a pointer that points to the top item in
//       a non-empty stack
// POST: the function returns the top item of the stack, and the
//       item has been popped off the stack
int pop (struct listNode **top);