Skip to content

Commit 90db983

Browse files
authored
Fix word typos in comments (TheAlgorithms#4928)
* fixed: spelling nonegative -> non-negative * fixed: spelling transpostiion -> transposition * fixed: spelling topolical -> topological * fixed: spelling sufix -> suffix
1 parent d530d2b commit 90db983

4 files changed

+5
-5
lines changed

sorts/bead_sort.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Bead sort only works for sequences of nonegative integers.
2+
Bead sort only works for sequences of non-negative integers.
33
https://en.wikipedia.org/wiki/Bead_sort
44
"""
55

sorts/odd_even_transposition_single_threaded.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Source: https://en.wikipedia.org/wiki/Odd%E2%80%93even_sort
33
4-
This is a non-parallelized implementation of odd-even transpostiion sort.
4+
This is a non-parallelized implementation of odd-even transposition sort.
55
66
Normally the swaps in each set happen simultaneously, without that the algorithm
77
is no better than bubble sort.

sorts/topological_sort.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
def topological_sort(start, visited, sort):
13-
"""Perform topolical sort on a directed acyclic graph."""
13+
"""Perform topological sort on a directed acyclic graph."""
1414
current = start
1515
# add current to visited
1616
visited.append(current)

strings/prefix_function.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
def prefix_function(input_string: str) -> list:
1515
"""
1616
For the given string this function computes value for each index(i),
17-
which represents the longest coincidence of prefix and sufix
17+
which represents the longest coincidence of prefix and suffix
1818
for given substring (input_str[0...i])
1919
2020
For the value of the first element the algorithm always returns 0
@@ -45,7 +45,7 @@ def prefix_function(input_string: str) -> list:
4545
def longest_prefix(input_str: str) -> int:
4646
"""
4747
Prefix-function use case
48-
Finding longest prefix which is sufix as well
48+
Finding longest prefix which is suffix as well
4949
5050
>>> longest_prefix("aabcdaabc")
5151
4

0 commit comments

Comments
 (0)