This is heapifying the array question and
this is my constructor of the heapcls
which extends to Comparable
heapcls(T[] arr,boolean flag){
this(flag);
for (T item : arr) {
this.data.add(item);
}
for(int i=this.data.size()-1;i>=0;i--){
this.downheapify(i);
}
}
public static void main(String[] args) {
int[]arr={7,8,9,5,11,3,10,1,6,2,4,12,0,-1,13};
heapcls<Integer> client=`enter code here`new heapcls<>(arr,false);
}
this statement is giving ," Cannot infer type arguments error"
how should I change my CompareTo(by default function) to rectify the error. since i havent overridden the bydefault CompareTo function.pls guide me.