Skip to content

Commit 434ab6f

Browse files
Fix typos in function and variable names (TheAlgorithms#632)
1 parent 51028c4 commit 434ab6f

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
324324
---
325325
##### Functions:
326326

327-
1. [`GeneticString`](./strings/genetic/genetic.go#L71): GeneticString generates PopultaionItem based on the imputed target string, and a set of possible runes to build a string with. In order to optimise string generation additional configurations can be provided with Conf instance. Empty instance of Conf (&Conf{}) can be provided, then default values would be set. Link to the same algorithm implemented in python: https://github.com/TheAlgorithms/Python/blob/master/genetic_algorithm/basic_string.py
327+
1. [`GeneticString`](./strings/genetic/genetic.go#L71): GeneticString generates PopulationItem based on the imputed target string, and a set of possible runes to build a string with. In order to optimise string generation additional configurations can be provided with Conf instance. Empty instance of Conf (&Conf{}) can be provided, then default values would be set. Link to the same algorithm implemented in python: https://github.com/TheAlgorithms/Python/blob/master/genetic_algorithm/basic_string.py
328328

329329
---
330330
##### Types

STYLE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Add the `_test` suffix to your package name to implement black-box testing for y
145145
### Symbol Naming
146146

147147
Go symbols should be named in the `camelCase` or `PascalCase`, depending of whether the symbol
148-
is exported or not. The case when using acronymns in names should be consistent. Use `json` or
148+
is exported or not. The case when using acronyms in names should be consistent. Use `json` or
149149
`JSON` instead of `Json`.
150150

151151
For exported symbols, use the package name to your advantage to write concise symbol names. For

dynamic/longestincreasingsubsequencegreedy.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ package dynamic
77
// Auxiliary Space: O(n), where n is the length of the array(slice).
88
// Reference: https://www.geeksforgeeks.org/construction-of-longest-monotonically-increasing-subsequence-n-log-n/
99
func LongestIncreasingSubsequenceGreedy(nums []int) int {
10-
longestIncreasingSubsequnce := make([]int, 0)
10+
longestIncreasingSubsequence := make([]int, 0)
1111

1212
for _, num := range nums {
13-
// find the leftmost index in longestIncreasingSubsequnce with value >= num
14-
leftmostIndex := lowerBound(longestIncreasingSubsequnce, num)
13+
// find the leftmost index in longestIncreasingSubsequence with value >= num
14+
leftmostIndex := lowerBound(longestIncreasingSubsequence, num)
1515

16-
if leftmostIndex == len(longestIncreasingSubsequnce) {
17-
longestIncreasingSubsequnce = append(longestIncreasingSubsequnce, num)
16+
if leftmostIndex == len(longestIncreasingSubsequence) {
17+
longestIncreasingSubsequence = append(longestIncreasingSubsequence, num)
1818
} else {
19-
longestIncreasingSubsequnce[leftmostIndex] = num
19+
longestIncreasingSubsequence[leftmostIndex] = num
2020
}
2121
}
2222

23-
return len(longestIncreasingSubsequnce)
23+
return len(longestIncreasingSubsequence)
2424
}
2525

2626
// Function to find the leftmost index in arr with value >= val, mimicking the inbuild lower_bound function in C++

math/modular/exponentiation_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// exponentiation_test.go
2-
// description: Test for ModularExponentation
2+
// description: Test for ModularExponentiation
33
// author(s) [Taj](https://github.com/tjgurwara99)
44
// see exponentiation.go
55

search/binary_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func TestLowerBound(t *testing.T) {
3939
}
4040

4141
func TestUpperBound(t *testing.T) {
42-
for _, test := range uppperBoundTests {
42+
for _, test := range upperBoundTests {
4343
actualValue, actualError := UpperBound(test.data, test.key)
4444
if actualValue != test.expected {
4545
t.Errorf("test '%s' failed: input array '%v' with key '%d', expected '%d', get '%d'", test.name, test.data, test.key, test.expected, actualValue)

search/testcases.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var lowerBoundTests = []searchTest{
4343
{[]int{}, 2, -1, ErrNotFound, "Empty"},
4444
}
4545

46-
var uppperBoundTests = []searchTest{
46+
var upperBoundTests = []searchTest{
4747
//Sanity
4848
{[]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, -25, 0, nil, "Sanity"},
4949
{[]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, 1, 1, nil, "Sanity"},

strings/genetic/genetic.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ type Result struct {
6060
Best PopulationItem
6161
}
6262

63-
// GeneticString generates PopultaionItem based on the imputed target
63+
// GeneticString generates PopulationItem based on the imputed target
6464
// string, and a set of possible runes to build a string with. In order
6565
// to optimise string generation additional configurations can be provided
6666
// with Conf instance. Empty instance of Conf (&Conf{}) can be provided,

structure/trie/trie_bench_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func BenchmarkTrie_Insert(b *testing.B) {
2222
}
2323
}
2424

25-
func BenchmarkTrie_Find_non_existant(b *testing.B) {
25+
func BenchmarkTrie_Find_non_existent(b *testing.B) {
2626

2727
insert := make([]string, 3000)
2828
for i := 0; i < len(insert); i++ {
@@ -37,7 +37,7 @@ func BenchmarkTrie_Find_non_existant(b *testing.B) {
3737
}
3838
}
3939

40-
func BenchmarkTrie_Find_existant(b *testing.B) {
40+
func BenchmarkTrie_Find_existent(b *testing.B) {
4141
insert := make([]string, 3000)
4242
for i := 0; i < len(insert); i++ {
4343
insert[i] = fmt.Sprintf("%f", rand.Float64())

0 commit comments

Comments
 (0)