#ifndef GLIST_H #define GLIST_H #include // objects of class "block" are the building blocks of a list . // each block has an information inside it ,prev and next pointers. class block { public: block* next; block* prev; block(){ next=NULL; prev=NULL; } virtual void show()=0; virtual void change(char* str)=0; void AddAfter(block* Nblock) { next=Nblock; Nblock->prev=this; } void AddBefore(block* Nblock) { prev=Nblock; Nblock->next =this; } block* GetNext() { return next; } block* GetPrevious() { return prev; } virtual void Clear()=0; }; class list { protected: block *root ; block *tail ; long size; public: list(); ~list(); void AddToEnd(block *Nblock); void AddToFront(block *Nblock); block* GetFirst() { return root; } block* GetLast() { return tail; } long Size() { return size; } void Clear(); virtual int del(); virtual void print(); void print_i(int i); block* return_i(int i); }; #endif