Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int tree :: f1_1(tree_node *root, int k, int &res)
- {
- tree_node *r;
- int count_child=0;
- if(!root)
- return 0;
- r = root->child;
- while(r)
- {
- count_child++;
- f1_1(r,k,res);
- r = r->brother;
- }
- if(count_child==k)
- res++;
- return 0;
- }
- int tree :: f1(tree_node *root, int k)
- {
- int ret=0;
- f1_1(root,k,ret);
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement