function validateBst(root, min=-Infinity, max=Infinity) {
if (!root) return true;
if (root.value <= min || root.value > max) return false;
return validateBst(root.left, min, root.value) && validateBst(root.right,root.value, max)
}
Can someone clarify this for me...is this space complexity of this function O(log(n)) or O(d) - where d is the depth of the BST tree?
...can I classify them as the same thing?