MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / solve

Function solve

InterviewBit_problems/Symmetric_Traversal/Solution.cpp:21–26  ·  view source on GitHub ↗

The following function explains the inorder traversal of a Binary Tree , i.e. leftchild--node--right child :being its basic form.

Source from the content-addressed store, hash-verified

19 //The following function explains the inorder traversal of a Binary Tree , i.e.
20 // leftchild--node--right child :being its basic form.
21 void solve(TreeNode* A,vector<int> & result)
22 { if(A==NULL) return ;//BASE CASE IS IMP. ;in return nothing as void in func header
23 solve(A->left,result);
24 result.push_back(A->val);
25 solve(A->right,result);
26 }
27
28 //The following function shows how we can call the inorder traversal function.
29

Callers 1

symmetricTraversalMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected