Addes isBST
minDepth logic