Advertisement
Ne-Biolog

Untitled

Apr 26th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. vector<int> g[100];
  2.  
  3. void solve(Tree *root, int dep) {
  4. g[dep].push_back(root->data);
  5. if(root->left != null) {
  6. solve(root->left, dep + 1);
  7. }
  8. if(root->right != null) {
  9. solve(root->right, dep + 1);
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement