Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. ics::pair<int,int> stats (const DTN& root) {
  2. ics::pair<int,int> pair(0,0);
  3.  
  4. if (root.is_word)
  5. ++pair.second;
  6. ++pair.first;
  7. for (auto it = root.children.begin(); it != root.children.end(); ++it){
  8. ics::pair<char,DTN> entry = *it;
  9. ics::pair<int,int> temptemp =stats(entry.second);
  10. pair.first += temptemp.first;
  11. pair.second += temptemp.second;
  12. }
  13. return pair;
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement