From b87b1102d0f12219dc288707d6141b283839d676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=AA=20Nam=20Kh=C3=A1nh?= <55955273+khanhkhanhlele@users.noreply.github.com> Date: Wed, 5 Nov 2025 17:35:18 +0700 Subject: [PATCH] chore: fix typos in src/main/java/com/thealgorithms/datastructures/queues/PriorityQueues.java (#7028) Fix typos in src/main/java/com/thealgorithms/datastructures/queues/PriorityQueues.java Co-authored-by: a <19151554+alxkm@users.noreply.github.com> --- .../datastructures/queues/PriorityQueues.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/thealgorithms/datastructures/queues/PriorityQueues.java b/src/main/java/com/thealgorithms/datastructures/queues/PriorityQueues.java index a5ca48670..b877a5843 100644 --- a/src/main/java/com/thealgorithms/datastructures/queues/PriorityQueues.java +++ b/src/main/java/com/thealgorithms/datastructures/queues/PriorityQueues.java @@ -9,7 +9,7 @@ package com.thealgorithms.datastructures.queues; * give numbers that are bigger, a higher priority. Queues in theory have no * fixed size but when using an array implementation it does. *
- * Additional contibutions made by: PuneetTri(https://github.com/PuneetTri) + * Additional contributions made by: PuneetTri(https://github.com/PuneetTri) */ class PriorityQueue { @@ -32,8 +32,8 @@ class PriorityQueue { PriorityQueue() { /* If capacity is not defined, default size of 11 would be used - * capacity=max+1 because we cant access 0th element of PQ, and to - * accomodate (max)th elements we need capacity to be max+1. + * capacity=max+1 because we can't access 0th element of PQ, and to + * accommodate (max)th elements we need capacity to be max+1. * Parent is at position k, child at position (k*2,k*2+1), if we * use position 0 in our queue, its child would be at: * (0*2, 0*2+1) -> (0,0). This is why we start at position 1 @@ -127,7 +127,7 @@ class PriorityQueue { if (isEmpty()) { throw new RuntimeException("Queue is Empty"); } else { - int max = queueArray[1]; // By defintion of our max-heap, value at queueArray[1] pos is + int max = queueArray[1]; // By definition of our max-heap, value at queueArray[1] pos is // the greatest // Swap max and last element