MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / find

Function find

CPP/Trees/tree_foldable.cpp:7–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5// If one of the subtree is found out to be mirror of the other one, return true
6
7bool find(node *node1, node *node2)
8{
9 if (node1 == NULL && node2 == NULL)
10 {
11 return true;
12 }
13 if (node1 == NULL || node2 == NULL)
14 {
15 return false;
16 }
17 return find(node1->left, node2->right) && find(node1->right, node2->left);
18}
19
20bool foldableCheck(node *root)
21{

Callers 8

foldableCheckFunction · 0.70
findMethod · 0.50
uniteMethod · 0.50
removeDuplicatesMethod · 0.50
searchMethod · 0.50
mainFunction · 0.50
mainFunction · 0.50
wordBreakFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected