Skip to content

Commit a47c1ef

Browse files
refactor 700
1 parent 814ecc6 commit a47c1ef

File tree

1 file changed

+0
-27
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-27
lines changed

src/main/java/com/fishercoder/solutions/_700.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,6 @@
22

33
import com.fishercoder.common.classes.TreeNode;
44

5-
/**
6-
* 700. Search in a Binary Search Tree
7-
*
8-
* Given the root node of a binary search tree (BST) and a value.
9-
* You need to find the node in the BST that the node's value equals the given value.
10-
* Return the subtree rooted with that node. If such node doesn't exist, you should return NULL.
11-
*
12-
* For example,
13-
*
14-
* Given the tree:
15-
* 4
16-
* / \
17-
* 2 7
18-
* / \
19-
* 1 3
20-
*
21-
* And the value to search: 2
22-
* You should return this subtree:
23-
*
24-
* 2
25-
* / \
26-
* 1 3
27-
* In the example above, if we want to search the value 5, since there is no node with value 5, we should return NULL.
28-
*
29-
* Note that an empty tree is represented by NULL,
30-
* therefore you would see the expected output (serialized tree format) as [], not null.
31-
* */
325
public class _700 {
336
public static class Solution1 {
347
public TreeNode searchBST(TreeNode root, int val) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy