Skip to content

Commit 22f508f

Browse files
committed
docs: fix typos in comments
Fix misspellings found with codespell: reccur/reccuring, positon, choosed, increate, contantating, and "Hava a Eulerian Path". Also rename the local variable formater to formatter in MathBuilder.
1 parent dd8df80 commit 22f508f

6 files changed

Lines changed: 12 additions & 12 deletions

File tree

‎src/main/java/com/thealgorithms/datastructures/lists/QuickSortLinkedList.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* List lessThanPivot : 3 -> 1 -> 2 -> 4
2121
* List greaterThanPivot : 5 -> 8 -> 10 -> 7 -> 9 -> 6
2222
*
23-
* -> reccur for lessThanPivot and greaterThanPivot
23+
* -> recur for lessThanPivot and greaterThanPivot
2424
*
2525
* lessThanPivot :
2626
* current pivot : 3
@@ -32,7 +32,7 @@
3232
* lessThanPivot : null
3333
* greaterThanPivot : 8 -> 10 -> 7 -> 9 -> 6
3434
*
35-
* By following the above pattern, reccuring tree will form like below :
35+
* By following the above pattern, the recursion tree will form like below :
3636
*
3737
* List-> 5 -> 3 -> 8 -> 1 -> 10 -> 2 -> 7 -> 4 -> 9 -> 6
3838
*
@@ -66,7 +66,7 @@
6666
* (N) (N) (N) (N)
6767
*
6868
*
69-
* -> After this the tree will reccur back (or backtrack)
69+
* -> After this the tree will recur back (or backtrack)
7070
* and the returning list from left and right subtree will attach
7171
* themselves around pivot.
7272
* i.e. ,

‎src/main/java/com/thealgorithms/datastructures/queues/PriorityQueues.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private void swim(int pos) {
8585
private void sink(int pos) {
8686
// Check if node's position is that of parent node
8787
while (2 * pos <= nItems) {
88-
int current = 2 * pos; // Jump to the positon of child node
88+
int current = 2 * pos; // Jump to the position of child node
8989
// Compare both the children for the greater one
9090
if (current < nItems && queueArray[current] < queueArray[current + 1]) {
9191
current++;

‎src/main/java/com/thealgorithms/maths/MathBuilder.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,17 +481,17 @@ public Builder closeParenthesisAndDivide() {
481481
}
482482

483483
public Builder format(String format) {
484-
DecimalFormat formater = new DecimalFormat(format);
485-
String num = formater.format(number);
484+
DecimalFormat formatter = new DecimalFormat(format);
485+
String num = formatter.format(number);
486486
number = Double.parseDouble(num);
487487
return this;
488488
}
489489

490490
public Builder format(int decimalPlace) {
491491
String pattern = "."
492492
+ "#".repeat(decimalPlace);
493-
DecimalFormat formater = new DecimalFormat(pattern);
494-
String num = formater.format(number);
493+
DecimalFormat formatter = new DecimalFormat(pattern);
494+
String num = formatter.format(number);
495495
number = Double.parseDouble(num);
496496
return this;
497497
}

‎src/main/java/com/thealgorithms/sorts/LinkListSort.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static boolean isSorted(int[] p, int option) {
1313
int[] b = p;
1414
// array similar to a
1515
int ch = option;
16-
// Choice is choosed as any number from 1 to 3 (So the linked list will be
16+
// Choice is chosen as any number from 1 to 3 (So the linked list will be
1717
// sorted by Merge sort technique/Insertion sort technique/Heap sort technique)
1818
switch (ch) {
1919
case 1:

‎src/main/java/com/thealgorithms/strings/zigZagPattern/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ for example :
2828
height which starts with 1 and start with starting index of string.
2929
than we generate spaces to skip using formula 2 + (( n - 1 ) * 2 )
3030
for both height and depth
31-
with each iteration we decrement depth and increate height and start
32-
by one also we keep contantating character on to new string with first
31+
with each iteration we decrement depth and increase height and start
32+
by one also we keep concatenating character on to new string with first
3333
depth spaces and later height spaces that we generated using formula
3434
if not zero
3535

‎src/test/java/com/thealgorithms/graph/HierholzerEulerianPathTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void testMultipleEdgesBetweenSameNodes() {
153153
HierholzerEulerianPath solver = new HierholzerEulerianPath(graph);
154154
List<Integer> result = solver.findEulerianPath();
155155

156-
// Hava a Eulerian Path but not a Eulerian Circuit
156+
// Has an Eulerian Path but not an Eulerian Circuit
157157
assertEquals(result, Arrays.asList(0, 1, 2, 0, 1));
158158
}
159159

0 commit comments

Comments
 (0)