EXERCISE · AlgoCasts

Validate BST

Given a node, validate the binary search tree, ensuring that every node's left hand child is less than the parent node's value, and that every node's right hand child is greater than the parent

2 testsAlgoCastsGPL-3.0exercise 25 of 26

Directions

Directions

Given a node, validate the binary search tree, ensuring that every node's left hand child is less than the parent node's value, and that every node's right hand child is greater than the parent

Try it first#

Copy the stub, make the 2 tests pass on your machine, then open the solution. The reveal is remembered per page in this browser.

JSexercises/validate/index.js
function validate(node, min = null, max = null) {} module.exports = validate;

See also