You are viewing a single comment's thread. Return to all comments →
Getting ""Error: Could not find or load main class Solution"" error for the below Java 8 code. The same code runs in IntelliJ.
boolean checkBST(Node root) { return checkBST(root, Long.MIN_VALUE, Long.MAX_VALUE); } boolean checkBST(Node root, long minVal, long maxVal){ if (root == null) return true; if (root.data >= maxVal || root.data <= minVal) return false; return checkBST(root.left, minVal, root.data) && checkBST(root.right, root.data, maxVal); }
Seems like cookies are disabled on this browser, please enable them to open this website
Is This a Binary Search Tree?
You are viewing a single comment's thread. Return to all comments →
Getting ""Error: Could not find or load main class Solution"" error for the below Java 8 code. The same code runs in IntelliJ.