MCPcopy Create free account
hub / github.com/Ainevsia/Leetcode-Rust / deepcopy

Method deepcopy

95. Unique Binary Search Trees II/Solution.cpp:55–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 }
54
55 TreeNode * deepcopy(TreeNode * root) {
56 if (root == NULL) return NULL;
57 TreeNode * p = new TreeNode(root->val);
58 p->left = deepcopy(root->left);
59 p->right = deepcopy(root->right);
60 return p;
61 }
62};
63
64int main() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected