Advertisement
Derga

Untitled

Sep 10th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include "solution_tree.h"
  2. #include <vector>
  3. #include <iostream>
  4. #include <algorithm>
  5.  
  6. using namespace std;
  7.  
  8. int Solution(const Node* root) {
  9.     if (!root) {
  10.         return 0;
  11.     }
  12.  
  13.     return max(Solution(root->left), Solution(root->right)) + 1;
  14. }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement