diff --git a/sorts/bead_sort.py b/sorts/bead_sort.py index 3767e842d8c2..26a3fabc4807 100644 --- a/sorts/bead_sort.py +++ b/sorts/bead_sort.py @@ -1,5 +1,5 @@ """ -Bead sort only works for sequences of nonegative integers. +Bead sort only works for sequences of non-negative integers. https://en.wikipedia.org/wiki/Bead_sort """ diff --git a/sorts/odd_even_transposition_single_threaded.py b/sorts/odd_even_transposition_single_threaded.py index fe06459e8dd1..f6cf7fba2a71 100644 --- a/sorts/odd_even_transposition_single_threaded.py +++ b/sorts/odd_even_transposition_single_threaded.py @@ -1,7 +1,7 @@ """ Source: https://en.wikipedia.org/wiki/Odd%E2%80%93even_sort -This is a non-parallelized implementation of odd-even transpostiion sort. +This is a non-parallelized implementation of odd-even transposition sort. Normally the swaps in each set happen simultaneously, without that the algorithm is no better than bubble sort. diff --git a/sorts/topological_sort.py b/sorts/topological_sort.py index e7a52f7c7714..59a0c8571b53 100644 --- a/sorts/topological_sort.py +++ b/sorts/topological_sort.py @@ -10,7 +10,7 @@ def topological_sort(start, visited, sort): - """Perform topolical sort on a directed acyclic graph.""" + """Perform topological sort on a directed acyclic graph.""" current = start # add current to visited visited.append(current) diff --git a/strings/prefix_function.py b/strings/prefix_function.py index 9e6dbbf5408f..6eca01635fe3 100644 --- a/strings/prefix_function.py +++ b/strings/prefix_function.py @@ -14,7 +14,7 @@ def prefix_function(input_string: str) -> list: """ For the given string this function computes value for each index(i), - which represents the longest coincidence of prefix and sufix + which represents the longest coincidence of prefix and suffix for given substring (input_str[0...i]) For the value of the first element the algorithm always returns 0 @@ -45,7 +45,7 @@ def prefix_function(input_string: str) -> list: def longest_prefix(input_str: str) -> int: """ Prefix-function use case - Finding longest prefix which is sufix as well + Finding longest prefix which is suffix as well >>> longest_prefix("aabcdaabc") 4