private static final SortedABPriQ<Integer> priorityQueue = new SortedABPriQ<>();
public static void randomNumGen() {
Random rand = new Random();
for(int i = 0; i < 100; i++){
int randomNumber = rand.nextInt(10000) + 1;
priorityQueue.enqueue(randomNumber);
}
}
public static void decreasing(){
//Print the numbers in decreasing order
System.out.println("Decreasing order:");//Displaying in 10 columns
int count = 0;
while (!priorityQueue.isEmpty()){
System.out.printf("%-10d", priorityQueue.dequeue());
count++;
if (count % 10 == 0) {
System.out.println();
}
}
}
public static void increasing(){
}
I got decreasing order down, mainly because the queue already puts it in decreasing, but not increasing. I cannot edit the priority queue code.