#ifndef LIST_H #define LIST_H /* ------------------------------------------------------------------------- */ /* list1.h */ /* declaration module for templated singly linked circular list class */ /* with global memory alloc'n */ /* ------------------------------------------------------------------------- */ #include template class List1 { private: // node structure struct Node { Dtype Datum; Node* Next; Node( const Dtype& v, Node* p = 0 ) : Datum(v), Next(p) { } }; // Data Node* Back; int Count; public: // Constructors List1( ) { Back = 0; Count = 0; } // Destructor ~List1( ) { MakeEmpty( ); } // Member functions void MakeEmpty( ); void push_front(const Dtype & X); void push_back(const Dtype & X); void pop_front( ); Dtype & front( ) const; Dtype & back( ) const; int IsEmpty( ) const; int Length( ) const; void Print( ) const; void Reverse( ); void Concat( List1 & Y ); }; #include "list1.cc" #endif