Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5734e0a

Browse files
Felix Rillingtrekhleb
Felix Rilling
authored andcommitted
Fix typos (trekhleb#59)
* Fixed typo in the word 'independant'* Fixed typo in the word 'subsequnce'* Fixed typo in the word 'icecream'* Fixed typo in the word 'subsequnce' in shortestCommonSubsequence* Fixed typo in the word 'depected'* Fixed typo in the word 'paramaters'
1 parent19aa6fa commit5734e0a

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

‎src/algorithms/graph/articulation-points/articulationPoints.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class VisitMetadata {
99
this.lowDiscoveryTime=lowDiscoveryTime;
1010
// We need this in order to check graph root node, whether it has two
1111
// disconnected children or not.
12-
this.independantChildrenCount=0;
12+
this.independentChildrenCount=0;
1313
}
1414
}
1515

@@ -49,7 +49,7 @@ export default function articulationPoints(graph) {
4949

5050
if(previousVertex){
5151
// Update children counter for previous vertex.
52-
visitedSet[previousVertex.getKey()].independantChildrenCount+=1;
52+
visitedSet[previousVertex.getKey()].independentChildrenCount+=1;
5353
}
5454
},
5555
/**
@@ -85,7 +85,7 @@ export default function articulationPoints(graph) {
8585
// 2. If its visited time is <= low time of adjacent vertex.
8686
if(previousVertex===startVertex){
8787
// Check that root vertex has at least two independent children.
88-
if(visitedSet[previousVertex.getKey()].independantChildrenCount>=2){
88+
if(visitedSet[previousVertex.getKey()].independentChildrenCount>=2){
8989
articulationPointsSet[previousVertex.getKey()]=previousVertex;
9090
}
9191
}else{

‎src/algorithms/sets/combinations/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ It is often called "n choose r" (such as "16 choose 3"). And is also known as th
3030

3131
Repetition is Allowed: such as coins in your pocket`(5,5,5,10,10)`
3232

33-
Or let us say there are five flavours oficecream:
33+
Or let us say there are five flavours ofice cream:
3434
`banana`,`chocolate`,`lemon`,`strawberry` and`vanilla`.
3535

3636
We can have three scoops. How many variations will there be?

‎src/algorithms/sets/longest-common-subsequnce/__test__/longestCommonSubsequnce.test.jsrenamed to‎src/algorithms/sets/longest-common-subsequence/__test__/longestCommonSubsequence.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
importlongestCommonSubsequncefrom'../longestCommonSubsequnce';
1+
importlongestCommonSubsequencefrom'../longestCommonSubsequence';
22

3-
describe('longestCommonSubsequnce',()=>{
3+
describe('longestCommonSubsequence',()=>{
44
it('should find longest common subsequence for two strings',()=>{
5-
expect(longestCommonSubsequnce([''],[''])).toEqual(['']);
5+
expect(longestCommonSubsequence([''],[''])).toEqual(['']);
66

7-
expect(longestCommonSubsequnce([''],['A','B','C'])).toEqual(['']);
7+
expect(longestCommonSubsequence([''],['A','B','C'])).toEqual(['']);
88

9-
expect(longestCommonSubsequnce(['A','B','C'],[''])).toEqual(['']);
9+
expect(longestCommonSubsequence(['A','B','C'],[''])).toEqual(['']);
1010

11-
expect(longestCommonSubsequnce(
11+
expect(longestCommonSubsequence(
1212
['A','B','C'],
1313
['D','E','F','G'],
1414
)).toEqual(['']);
1515

16-
expect(longestCommonSubsequnce(
16+
expect(longestCommonSubsequence(
1717
['A','B','C','D','G','H'],
1818
['A','E','D','F','H','R'],
1919
)).toEqual(['A','D','H']);
2020

21-
expect(longestCommonSubsequnce(
21+
expect(longestCommonSubsequence(
2222
['A','G','G','T','A','B'],
2323
['G','X','T','X','A','Y','B'],
2424
)).toEqual(['G','T','A','B']);
2525

26-
expect(longestCommonSubsequnce(
26+
expect(longestCommonSubsequence(
2727
['A','B','C','D','A','F'],
2828
['A','C','B','C','F'],
2929
)).toEqual(['A','B','C','F']);

‎src/algorithms/sets/longest-common-subsequnce/longestCommonSubsequnce.jsrenamed to‎src/algorithms/sets/longest-common-subsequence/longestCommonSubsequence.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*@param {string[]} set2
44
*@return {string[]}
55
*/
6-
exportdefaultfunctionlongestCommonSubsequnce(set1,set2){
6+
exportdefaultfunctionlongestCommonSubsequence(set1,set2){
77
// Init LCS matrix.
88
constlcsMatrix=Array(set2.length+1).fill(null).map(()=>Array(set1.length+1).fill(null));
99

‎src/algorithms/sets/shortest-common-supersequence/shortestCommonSupersequence.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
importlongestCommonSubsequncefrom'../longest-common-subsequnce/longestCommonSubsequnce';
1+
importlongestCommonSubsequencefrom'../longest-common-subsequence/longestCommonSubsequence';
22

33
/**
44
*@param {string[]} set1
@@ -8,9 +8,9 @@ import longestCommonSubsequnce from '../longest-common-subsequnce/longestCommonS
88

99
exportdefaultfunctionshortestCommonSupersequence(set1,set2){
1010
// Let's first find the longest common subsequence of two sets.
11-
constlcs=longestCommonSubsequnce(set1,set2);
11+
constlcs=longestCommonSubsequence(set1,set2);
1212

13-
// If LCS is empty then the shortest commonsupersequnce would be just
13+
// If LCS is empty then the shortest commonsupersequence would be just
1414
// concatenation of two sequences.
1515
if(lcs.length===1&&lcs[0]===''){
1616
returnset1.concat(set2);

‎src/algorithms/sorting/counting-sort/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ element is very small.
3232

3333
In first step we calculate the count of all the elements of the
3434
input array`A`. Then Store the result in the count array`C`.
35-
The way we count isdepected below.
35+
The way we count isdepicted below.
3636

3737
![Counting Sort](https://3.bp.blogspot.com/-jJchly1BkTc/WLGqCFDdvCI/AAAAAAAAAHA/luljAlz2ptMndIZNH0KLTTuQMNsfzDeFQCLcB/s1600/CSortUpdatedStepI.gif)
3838

‎src/algorithms/sorting/quick-sort/QuickSortInPlace.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default class QuickSortInPlace extends Sort {
5454
/*
5555
* While we can use a default parameter to set `low` to 0, we would
5656
* still have to set `high`'s default within the function as we
57-
* don't have access to `array.length - 1` when declaringparamaters
57+
* don't have access to `array.length - 1` when declaringparameters
5858
*/
5959
constlowIndex=inputLowIndex===undefined ?0 :inputLowIndex;
6060
consthighIndex=inputHighIndex===undefined ?array.length-1 :inputHighIndex;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp