Skip to content

Commit 616a3f0

Browse files
Update ReverseQueueRecursion.java
1 parent bd0cfc2 commit 616a3f0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/thealgorithms/datastructures/queues/ReverseQueueRecursion.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@
88
public final class ReverseQueueRecursion {
99

1010
private ReverseQueueRecursion() {
11-
// private constructor to prevent instantiation
11+
// Private constructor to prevent instantiation
1212
}
1313

1414
/**
1515
* Reverses the given queue recursively.
1616
*
1717
* @param queue the queue to reverse
18-
* @param <T> type of elements in the queue
18+
* @param <T> the type of elements in the queue
1919
*/
2020
public static <T> void reverseQueue(final Queue<T> queue) {
2121
if (queue == null || queue.isEmpty()) {
2222
return;
2323
}
24+
2425
final T front = queue.poll();
2526
reverseQueue(queue);
2627
queue.add(front);

0 commit comments

Comments
 (0)