# [Leet Code] Search in a Binary Search Tree

Leetcode: https://leetcode.com/problems/search-in-a-binary-search-tree/

Problem:

Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node’s value equals the given value. Return the subtree rooted with that node. If such node doesn’t exist, you should return NULL.

For example,

Given the tree:

4

/ \

2 7

/ \

1 3And the value to search: 2