MCPcopy Create free account
hub / github.com/SR-Sunny-Raj/Hacktoberfest2021-DSA / inorder

Method inorder

14. Tree/Recover-Binary-Tree.java:17–32  ·  view source on GitHub ↗
(TreeNode root)

Source from the content-addressed store, hash-verified

15 }
16
17 private void inorder(TreeNode root) {
18
19 if (root == null) {
20 return;
21 }
22 inorder(root.left);
23 if (prev != null && prev.val > root.val) {
24 if (a == null) {
25 a = prev;
26 }
27 b = root;
28 }
29 prev = root;
30 inorder(root.right);
31
32 }
33
34 public class TreeNode {
35

Callers 1

recoverTreeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected