Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BuildAllChains()
- {
- BuildSubChains(allSets, NULL);
- }
- BuildSubChains(sets, pParent)
- {
- if (sets is empty)
- return;
- trgObj = the most frequent object from sets;
- pNode = new Node;
- pNode->Object = trgObj;
- pNode->pParent = pParent;
- newSets = empty;
- for (each set in sets that contains the trgObj)
- {
- remove trgObj from set;
- remove set from sets;
- if (set is empty)
- set->pHead = pNode;
- else
- newSets.Insert(set);
- }
- BuildSubChains(sets, pParent);
- BuildSubChains(newSets, pNode);
- }
Add Comment
Please, Sign In to add comment