Академический Документы
Профессиональный Документы
Культура Документы
java.io.BufferedWriter;
java.io.File;
java.io.FileNotFoundException;
java.io.FileWriter;
java.io.IOException;
java.io.PrintWriter;
java.util.Arrays;
java.util.Scanner;
java.util.logging.Level;
java.util.logging.Logger;
/**
*
* @author byron
*/
public class HeapSort {
static int[] E;
static int[] H;
static int[] ee;
static int end;
//static String [] s;
public static void buildHeap(int[] E, int end) {//Construir Montn
for (int i = E.length / 2 - 1; i >= 0; i--) {// n/2 is the number of non-l
eave nodes
int k = E[i];
fixHeap(E, i, end, k);
}
}
tn
public static void fixHeap(int[] E, int root, int end, int k) {//Reparar Mon
}
return higher;
}
if (largest != i) {
exchange(i, largest);
maxHeap(E, largest);
}