⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hashtree.h

📁 数据挖掘中的经典算法Apriori实现
💻 H
字号:
// HashTree.h: interface for the CHashTree class.
//
//////////////////////////////////////////////////////////////////////

#include "list.h"
#include "itemSet.h"

#define BUCKET_SIZE 100 /* the number of itemsets in buckets in the hash tree*/
#define TABLE_SIZE 500 /* the number of buckets in the hash tree*///hash     mod TABLE_SIZE

#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 {
            list *largeset; /*corresponding to a leaf node*/
            HashNode *tab[TABLE_SIZE]; /*corresponding to a non-tem node, each bucket points to another node*///like the children nodes
    } vp;
};


class CHashTree {

public:

    HashNode *root;
    
    CHashTree();
    ~CHashTree();
    
    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, list *result, long minsup);
    
};

⌨️ 快捷键说明

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