class KDTree {

    public String toString(int indent) {
        int nextIndent = indent + 1;
        String tabs = new String(new char[nextIndent]).replace("\0", "\t");
        if (loChild != null && hiChild != null) {
            return String.format("<KDNode: spitDim=%d splitVal=%.3f \n%sLO: %s\n%sHI: %s", this.splitDimension, this.splitValue, tabs, this.loChild.toString(nextIndent), tabs, this.hiChild.toString(nextIndent));
        }
        else if (hiChild!= null) {
            return String.format("<KDNode: splitDim=%d splitVal=%.3f \n%sHI: %s", this.splitDimension, this.splitValue, tabs, this.hiChild.toString(nextIndent));
        }
        else if (loChild != null) {
            return String.format("<KDNode: splitDim=%d splitVal=%.3f \n%sLO: %s", this.splitDimension, this.splitValue, tabs, this.loChild.toString(nextIndent));
        }
        else {
            String all = "<KDNode>:\n";
            for (Datum datum: this.items) {
                all += String.format("%s - %s\n", tabs, datum.metrics());
            }
            return all;
        }

    }

    public  KDTree(List<Datum> data, int leafCapacity);

}