Guest User

Untitled

a guest
Nov 23rd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. BuildAllChains()
  2. {
  3. BuildSubChains(allSets, NULL);
  4. }
  5.  
  6. BuildSubChains(sets, pParent)
  7. {
  8. if (sets is empty)
  9. return;
  10.  
  11. trgObj = the most frequent object from sets;
  12.  
  13. pNode = new Node;
  14. pNode->Object = trgObj;
  15. pNode->pParent = pParent;
  16.  
  17. newSets = empty;
  18. for (each set in sets that contains the trgObj)
  19. {
  20. remove trgObj from set;
  21. remove set from sets;
  22.  
  23. if (set is empty)
  24. set->pHead = pNode;
  25. else
  26. newSets.Insert(set);
  27. }
  28.  
  29. BuildSubChains(sets, pParent);
  30. BuildSubChains(newSets, pNode);
  31. }
Add Comment
Please, Sign In to add comment