| 22 | } |
| 23 | |
| 24 | Int sum_tree(Node *node) { |
| 25 | Int result = 0; |
| 26 | if (node) { |
| 27 | result += node->val; |
| 28 | result += sum_tree(node->left); |
| 29 | result += sum_tree(node->right); |
| 30 | } |
| 31 | return result; |
| 32 | } |
| 33 | |
| 34 | static const int iter = 20; |
| 35 | static const int max_depth = 15; // 2^16-1 nodes. |