program works not well.. (data structure problem)

Dear all:
My program runs slowly. And I’m not sure if there is any problem with building a tree procedure? Can anybody please help me out? ( when the dataset got 13 attributes more in a transaction , the performance of prog ended up working not so well !)

My code/ My input data (input("test.dat.log") )
http://codepad.org/ywzkF8G1
http://codepad.org/abseVmvc

My program is object to count all the itemsets with its count.
For example: here are nine transactions below, and each batch processes three transactions
TID # itemsets(itemset is composed of 0~999 attributes)
===============
TID001 123
TID002 012
TID003 0123
------------------------
TID004 02
TID005 0
TID006 13
-------------------------
TID007 04
TID008 23
TID009 04
Here’s a result like this : itemset (frequency)
0 (6)
0 1 (2)
0 1 2 (2)
0 1 2 3 (1)
0 1 3 (1)
0 2 (3)
0 2 3 (1)
0 3 (1)
0 4 (2)
1 (4)
1 2 (3)
1 2 3 (2)
1 3 (3)
2 (5)
2 3 (3)
3 (4)
4 (2)

Main Functions:
1. Loadbuffer() : load data from the dataset (buffer_size)
2. run() , run2(), recur() : generating all the permutation, and output each permutation into output() function.
3. output() : assign an itemset to set() function and built a node corresponding to the tree
4. set(): built a node into my tree structure.
5. subset(): built a node whose length greater or equal to 1 by recurring subset() function.
6. Update(): insert or update an itemset of its node information
7. Visit(): traverse the node and return the Pointer
8. link_same_id() : by linking the same item_id to calculate the frequency of a item
9. rollback_same_id(): rollback the modified item_id array
10. List_Trie() : print the result

Tree structure:
use a binary tree structure by simulating the prefix tree
please see the power point file below:
http://mibhpwosiay.myweb.hinet.net/simulate.ppt

Thank you for taking time to read this !!
Topic archived. No new replies allowed.