forked from neetcode-gh/leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renaming Java files to correct format
- Loading branch information
Showing
25 changed files
with
15 additions
and
15 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 15 additions & 15 deletions
30
java/669-Trim-a-Binary-Search-Tree.java → java/0669-trim-a-binary-search-tree.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
class Solution { | ||
public TreeNode trimBST(TreeNode root, int low, int high) { | ||
if(root == null){ | ||
return root; | ||
} | ||
if(root.val > high){ | ||
return trimBST(root.left, low, high); | ||
} | ||
if(root.val < low){ | ||
return trimBST(root.right, low, high); | ||
} | ||
root.left = trimBST(root.left, low, high); | ||
root.right = trimBST(root.right, low, high); | ||
return root; | ||
} | ||
class Solution { | ||
public TreeNode trimBST(TreeNode root, int low, int high) { | ||
if(root == null){ | ||
return root; | ||
} | ||
if(root.val > high){ | ||
return trimBST(root.left, low, high); | ||
} | ||
if(root.val < low){ | ||
return trimBST(root.right, low, high); | ||
} | ||
root.left = trimBST(root.left, low, high); | ||
root.right = trimBST(root.right, low, high); | ||
return root; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.