private int nodeCount(TreeNode root) {

        if (root == null) return 0;

        return nodeCount(root.left) + nodeCount(root.right) + 1;
    }
Recursive Binary Search method. Time complexity is little higher than previous one but This does not use
any extra memory. We can use O(N) space in order to keep size of all nodes to make DP solution.
src/problems/medium/KthSmallestElementinaBST.java