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

Method recoverTree

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

Source from the content-addressed store, hash-verified

6 TreeNode b = null;
7
8 public void recoverTree(TreeNode root) {
9
10 inorder(root);
11 int temp = a.val;
12 a.val = b.val;
13 b.val = temp;
14
15 }
16
17 private void inorder(TreeNode root) {
18

Callers

nothing calls this directly

Calls 1

inorderMethod · 0.95

Tested by

no test coverage detected