📄 list.h,v
字号:
head 1.1;access;symbols;locks zaki:1.1; strict;comment @ * @;1.1date 2001.06.12.16.41.58; author zaki; state Exp;branches;next ;desc@Charm with Hashing.@1.1log@Initial revision@text@#ifndef __LISTS_H#define __LISTS_H//#ifdef __GNUC__//#pragma interface//#endiftemplate <class Items>class ListNodes {private: ListNodes<Items> *theNext; Items theItem; int chb;public: ListNodes(Items item, ListNodes<Items> *next); ~ListNodes(){} ListNodes<Items>* next (){ return theNext; } ListNodes<Items>*& lnext (){ return theNext; } Items& item(){ return theItem; } void set_item(Items it){ theItem = it;} void set_bit() { chb=1; } int chbit() { return chb;}};template <class Items>class List {private: ListNodes<Items> *theHead; ListNodes<Items> *theLast; int theSize; public: List(); ~List(); void clear(); ListNodes<Items> *head (){ return theHead; } ListNodes<Items> *last (){ return theLast; } int size (){ return theSize; } void set_head(ListNodes<Items> *hd){ theHead = hd;} void append (Items item); void prepend(Items item); int addsort (Items item, int (*cmp) (const void *, const void *), int ascend=1); void remove(ListNodes<Items> *prev, ListNodes<Items> *val); Items frontremove(); friend ostream& operator << (ostream& fout, List<Items>& lst);};#endif //__LISTS_H@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -