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

Function make_tree

ppcc/adlib/test1.cc:12–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10};
11
12Node *make_tree(int depth, Int &counter) {
13 Node *node = new Node();
14 if (depth != 0) {
15 node->left = make_tree(depth - 1, counter);
16 node->val = counter++;
17 node->right = make_tree(depth - 1, counter);
18 } else {
19 node->val = counter++;
20 }
21 return node;
22}
23
24Int sum_tree(Node *node) {
25 Int result = 0;

Callers 1

MainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected