hash.h

来自「apriori算法是数据挖掘的经典算法,它基于关联规则的思想.此为我的第3个收藏」· C头文件 代码 · 共 48 行

H
48
字号
//---------------------------------------------------------------------------#ifndef hashH#define hashH#include "util.h"#define BUCKET_SIZE 100 /* the number of buckets in the hash tree*/#define TABLE_SIZE 500 /* the number of buckets in the hash tree*/#define LEAF     1#define INTERNAL 2/* node in the hash tree*/typedef struct hashnode HashNode;struct hashnode{    int nodetype;  /* nodetype L=leaf, N=non-terminal node*/        union {            ItemSets *largeset; /*corresponding to a leaf node*/            HashNode *tab[TABLE_SIZE]; /*corresponding to a non-tem node, each bucket points to another node*/    } vp;};class HashTree {public:    HashNode *root;        HashTree();    ~HashTree();        int hash(ItemSet *itemset, int level);        HashNode * newnode(int nodetype);    void freenode(HashNode *node);    void insert(HashNode **hp, ItemSet *s, int level );    void subset(HashNode *head, ItemSet *t, int m);    void scan(HashNode *head, ItemSets *result, long minsup);    };#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?