garray.h
来自「最大频繁集挖掘算法GENMAX 源代码」· C头文件 代码 · 共 37 行
H
37 行
#ifndef __GARRAY_H#define __GARRAY_H#include <iostream.h>template <class Items>class GArray{private: int theSz; int totSz; Items *theAry;public: GArray(int sz=2); GArray(GArray<Items> *ary); ~GArray(); void copy (GArray<Items> *ary); void Realloc(int newlen); void compact(int nsz=-1); void add(Items it); void optadd(Items it){ theAry[theSz++] = it; } Items *& garray(){ return theAry; } void reset(){ theSz = 0; } int& size(){ return theSz; } int& totsize(){ return totSz; } Items& operator [] (unsigned int index){ return theAry[index]; } //friend ostream& operator << (ostream& fout, GArray<Items>& ary);};#endif //__GArray_H
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?