/* * OhResize3.java * * Created on March 5, 2008, 1:53 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package resizing; /** * * @author suchenek */ public class OhResize3 { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here int[] Array; int N; for (N = 11; N<=1000; N++) { Array = new int[N]; // for (int i = 0; i < N; i++) // Array[i] = (int)(Math.sqrt(97)*(13*i + 1)*(19*i + 2)+i - 17)%1000; for (int i = 0; i < N; i++) Array[i] = i; // for (int i = 0; i < N; i++) System.out.print(Array[i] + " "); // System.out.println(); cnt.clr(); PriorityQueueSort(Array); // for (int i = 0; i < N; i++) System.out.print(Array[i] + " "); // System.out.println(); System.out.print("T(" + N +")"); cnt.out(" = ", " <"); System.out.println(" " + (2*N - 10) + " = (2*N - 10)"); } } public static void PriorityQueueSort(int[] A) { int n = A.length; PriorityQueue3 PQ = new PriorityQueue3(); for (int i = 0; i < n; i++) PQ.insert(A[i]); // System.out.println("A Size of PQ is " + PQ.Length()); // for (int i = 0; i < n; i++) A[i]=PQ.remove(); // System.out.println("B Size of PQ is " + PQ.Length()); } }