Question: Please Help In Java: In this project I want you to add a method called deleteHeap, which will take this heap as parameter and delete
Please Help In Java:
In this project I want you to add a method called deleteHeap, which will take this heap as parameter and delete data from it until there is none left, storing the sorted data into an array, which is then passed back to main. Main will output this array, demonstrating that it is sorted. I suggest that you first leave the data hardcoded in the initial array (as I did). This makes it easier to debug because you know what the numbers are. But once everything is running, use the input file from Radixsort. Since (theoretically) you don't know how big your input file will be you will need to use an arrayList.
There will be partial credit for completing this with the input hard coded into an array, full points for being able to get it from an input file.
HeapExample1:
public static void main(String[] args) { Integer[]data = {56,8,13,41,5,104,11,39,57,62,90,60}; Integer[] heap = CreateHeap(data); for (int j=0; j<12; j++) System.out.print(heap[j]+ " "); return; } public static Integer[] CreateHeap(Integer[]data) { Integer[] heap = new Integer[12]; heap[0]=data[0]; for(int i=1; i<12; i++) { //insert data[n] heap[i]=data[i]; //reheap if necessary int n=i; while((n-1)/2>=0 && heap[(n-1)/2] Radixsort.txt: 2345 67 89 1145 36 39 40 11 95 4707 299 278 256 6189 170 8167 1459 1234 1226 998 889 4434 3912 4570 66
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
