MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / dfs

Function dfs

javascript/0098-validate-binary-search-tree.js:17–22  ·  view source on GitHub ↗
(root, min, max)

Source from the content-addressed store, hash-verified

15};
16
17const dfs = (root, min, max) => {
18 const left = isValidBST(root.left, min, root.val);
19 const right = isValidBST(root.right, root.val, max);
20
21 return left && right;
22};
23// TODO
24/**
25 * https://leetcode.com/problems/validate-binary-search-tree/

Callers 1

isValidBSTFunction · 0.70

Calls 1

isValidBSTFunction · 0.70

Tested by

no test coverage detected