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

Function inorder

CPP/Trees/RecoverBinarySearchTree.cpp:5–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3 TreeNode* second=NULL;
4
5 void inorder(TreeNode* root)
6{
7 if(root==NULL)
8 return;
9 inorder(root->left);
10
11 if(prev!=NULL && root->val<prev->val)
12 {
13 if(first==NULL)
14 first=prev;
15 second=root;
16 }
17 prev=root;
18 inorder(root->right);
19
20}
21void recoverTree(TreeNode* root)
22{
23 inorder(root);

Callers 1

recoverTreeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected