Programming Resources
For Fun and Learning
Charles Cusack
Computer Science
Hope College
main

Python

C++


JAVA
PHP
SQL
Assignments

DLListExamples


stackHasAdllist.h

//--------------------------------------------------------------------
// stackHasAdllist.h
//
// Written by Chuck Cusack, Feb 2001
//--------------------------------------------------------------------
// Stack Class
// Implemented using a Doubly Linked list with Head and Tail pointers
//--------------------------------------------------------------------
#ifndef STACK
#define STACK
//--------------------------------------------------------------------
#include "dllist.h"
//--------------------------------------------------------------------
class stack 
{
public:
    stack() {};  // Nothing to do
    ~stack() {}; // Nothing to do
    void Push(int K);
    int  Pop();
    int  Peek();
    void Purge();
    bool isEmpty () const;
private:
    dllist Q;
};
#endif