Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Week 3/Search in BST
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ class Solution {
return null;
if(root.val==val)
return root;
//if val is less than root.val
if(val<root.val){
return searchBSTUtil(root.left,val);
//if val is greater than root.val
}else
return searchBSTUtil(root.right,val);
}
Expand Down