MCPcopy Create free account
hub / github.com/Singular/Singular / sum_tree

Function sum_tree

ppcc/adlib/test1.cc:24–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24Int 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
34static const int iter = 20;
35static const int max_depth = 15; // 2^16-1 nodes.

Callers 1

MainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected