// dlist.h // header file for class Dlist #ifndef _DLIST_H_ #define _DLIST_H_ #include "dnode.h" typedef int Type; class Dlist { public: Dlist(); ~Dlist(); Dnode *firstnode(); // this is not really the "right" Dnode *lastnode(); // way to access the list. A better // approach is to use a list iterator. void insertfirst(Type x); void insertlast(Type x); void insertright(Type x, Dnode *p); void insertleft(Type x, Dnode *p); Type removefirst(); Type removelast(); Type removeright(Dnode *p); Type removeleft(Dnode *p); Type remove(Dnode *p); int find(Type x); int isempty(); void print(); private: Dnode *leftend; Dnode *rightend; }; #endif