Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. void najmanji(node *root)
  2. {
  3. if(!root) return;
  4. node *current;
  5. for(current = root; current->left; current = current->left);
  6. cout << "Najmanji element u stablu je "<< current->value << endl;
  7. }
  8.  
  9.  
  10.  
  11. int suma(node *root)
  12. {
  13. if (root == NULL)
  14. return 0;
  15. return (root->value + suma(root->left) + suma(root->right));
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement