mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-27 06:23:08 +08:00
Format code with prettier (#3375)
This commit is contained in:
@ -69,7 +69,6 @@ public class CircularQueue {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int peek() {
|
||||
@ -86,7 +85,6 @@ public class CircularQueue {
|
||||
System.out.println("The Queue is deleted!");
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
CircularQueue cq = new CircularQueue(5);
|
||||
System.out.println(cq.isEmpty());
|
||||
@ -110,6 +108,5 @@ public class CircularQueue {
|
||||
System.out.println(cq.peek());
|
||||
System.out.println(cq.peek());
|
||||
cq.deleteQueue();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -121,8 +121,7 @@ public class PriorityQueues {
|
||||
// [2, 3, 5, 10] Here higher numbers have higher priority, so they are on the top
|
||||
|
||||
for (int i = 3; i >= 0; i--) {
|
||||
System.out.print(
|
||||
myQueue.remove() + " "); // will print the queue in reverse order [10, 5, 3, 2]
|
||||
System.out.print(myQueue.remove() + " "); // will print the queue in reverse order [10, 5, 3, 2]
|
||||
}
|
||||
// As you can see, a Priority Queue can be used as a sorting algotithm
|
||||
}
|
||||
|
Reference in New Issue
Block a user