BILIST.H
资源名称:C++100.rar [点击查看]
上传用户:wszmarenbt
上传日期:2013-04-26
资源大小:2552k
文件大小:1k
源码类别:
Windows编程
开发平台:
Visual C++
- //THIS HEAD FILE DEFINES A "DOUBLE DIRECTION LIST" CLASS
- //FILE BILIST.H
- #include <stdio.h>
- class NODE
- {
- //FRIEND CLASS "LIST" CAN HAVE ACCESS TO THE CLASS "NODE" 'S PRIVATE PART
- friend class LIST;
- private :
- //PREVIOUS NODE LINK
- NODE *PREVIOUS;
- //NEXT NODE LINK
- NODE *NEXT;
- //THE CURRENT NODE DATA
- int DATA;
- };
- class LIST
- {
- private :
- //THE HEAD OF THE LIST
- NODE *HEAD;
- //THE TAIL OF THE LIST
- NODE *TAIL;
- public :
- //CONSTRUCTOR FUNCTION
- LIST()
- {
- //INITIAL
- HEAD=0;
- TAIL=0;
- }
- //ADD TO THE BACK OF THE LIST
- void Build_HT(int Data);
- //ADD TO THE FRONT OF THE LIST
- void Build_TH(int Data);
- //DISPLAY THE DATA OF THE LIST FROM HEAD TO TAIL
- void LIST::DISPLAY_HT();
- //DISPLAY THE DATA OF THE LIST FROM TAIL TO HEAD
- void LIST::DISPLAY_TH();
- //REMOVE ALL THE NODES IN THE LIST
- void CLEAR();
- ~LIST()
- {
- CLEAR();
- }
- };