Advertisement
dyamondz

Nombre d'aparicions d'un valor en un arbre general - X96511

Jun 18th, 2018
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. void i_freq(const T& x, node_arbreGen* node, int&num) const{
  2.     if(node != NULL){
  3.         if(node->info == x) ++num;
  4.         for(int i=0; i<node->seg.size(); ++i){
  5.             i_freq(x,node->seg[i],num);
  6.         }
  7.     }
  8. }
  9.  
  10. int freq(const T& x) const{
  11.     int n=0;
  12.     i_freq(x, this->primer_node, n);
  13.     return n;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement