Skip to content

#700 - Search in a Binary Search Tree

EasyBinary Search Tree
Open on LeetCode

Given the root of a BST and an integer val, find the node whose value equals val and return its subtree. If the node doesn't exist, return null.

InputOutput
root = [4,2,7,1,3], val = 2[2,1,3]
root = [4,2,7,1,3], val = 5null

Released under the MIT License.