Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0790b0e

Browse filesBrowse files
committed
commit
Change-Id: I820959b1cfc713576e66ee7653b8ab36ac7418c3
1 parent 5e1d814 commit 0790b0e
Copy full SHA for 0790b0e

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎[0669][Trim a Binary Search Tree]/src/Solution.java

Copy file name to clipboardExpand all lines: [0669][Trim a Binary Search Tree]/src/Solution.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ public TreeNode trimBST(TreeNode root, int L, int R) {
1313

1414
if (root.val == L) {
1515
root.left = null;
16-
root.right = trimBST(root, L, R);
16+
root.right = trimBST(root.right, L, R);
1717
return root;
1818
} else if (root.val == R) {
19-
root.right = null;
2019
root.left = trimBST(root.left, L, R);
20+
root.right = null;
2121
return root;
2222
} else if (root.val < L) {
2323
return trimBST(root.right, L, R);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.