X Tutup
Skip to content

Commit d712bfd

Browse files
authored
chore: Merge pull request TheAlgorithms#739 from keshav-bohr/spell-check
fixed some spellings
2 parents 17ac987 + e27bc0a commit d712bfd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+81
-81
lines changed

Backtracking/SumOfSubset.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Given an ordered set W of non-negative integers and a value K,
66
* determine all possible subsets from the given set W whose sum
7-
* of its elemets equals to the given value K.
7+
* of its elements equals to the given value K.
88
*
99
* More info: https://www.geeksforgeeks.org/subset-sum-backtracking-4/
1010
*/
@@ -53,7 +53,7 @@ const sumOfSubset = (set, subset, setindex, sum, targetSum) => {
5353
targetSum
5454
)
5555

56-
// Concat the recursive result with current result arary
56+
// Concat the recursive result with current result array
5757
results = [...results, ...subsetResult]
5858
})
5959

Bit-Manipulation/BinaryCountSetBits.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
license: GPL-3.0 or later
44
55
This script will find number of 1's
6-
in binary representain of given number
6+
in binary representation of given number
77
88
*/
99

1010
function BinaryCountSetBits (a) {
1111
'use strict'
12-
// convert number into binary representation and return number of set bits in binary representaion
12+
// convert number into binary representation and return number of set bits in binary representation
1313
return a.toString(2).split('1').length - 1
1414
}
1515

Ciphers/KeyFinder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function keyFinder (str) { // str is used to get the input of encrypted string
4848
// console.log( k + outStrElement + wordBank[i] );//debug
4949

5050
// this part need to be optimize with the calculation of the number of occurrence of word's probabilities
51-
// linked list will be used in the next stage of development to calculate the number of occurace of the key
51+
// linked list will be used in the next stage of development to calculate the number of occurrence of the key
5252
if (wordBank[i] === outStrElement) {
5353
return k // return the key number if founded
5454
}

Conversions/DateDayDifference.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ const DateDayDifference = (date1, date2) => {
2222
if (typeof date1 !== 'string' && typeof date2 !== 'string') {
2323
return new TypeError('Argument is not a string.')
2424
}
25-
// extarct the first date
25+
// extract the first date
2626
const [firstDateDay, firstDateMonth, firstDateYear] = date1.split('/').map((ele) => Number(ele))
27-
// extarct the second date
27+
// extract the second date
2828
const [secondDateDay, secondDateMonth, secondDateYear] = date2.split('/').map((ele) => Number(ele))
2929
// check the both data are valid or not.
3030
if (firstDateDay < 0 || firstDateDay > 31 ||

Conversions/DateToDay.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const DateToDay = (date) => {
4444
if (typeof date !== 'string') {
4545
return new TypeError('Argument is not a string.')
4646
}
47-
// extarct the date
47+
// extract the date
4848
const [day, month, year] = date.split('/').map((x) => Number(x))
4949
// check the data are valid or not.
5050
if (day < 0 || day > 31 || month > 12 || month < 0) {

Conversions/RailwayTimeConversion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
want some changes in hour value.
66
77
Input Formate -> 07:05:45PM
8-
Output Fromate -> 19:05:45
8+
Output Formate -> 19:05:45
99
1010
Problem & Explanation Source : https://www.mathsisfun.com/time.html
1111
*/

Conversions/TitleCaseConversion.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Problem statement and Explanation : https://www.codeproject.com/Tips/162540/Letter-Case-Conversion-Algorithms-Title-Case-Toggl.
33
[Title case](https://en.wikipedia.org/wiki/Title_case) is a style where all words are capitalized. Officially, title case
44
does not capitalize some words, such as very short words like "a" or "is", but for the purposes of this function, a general approach
5-
is taken where all words are capitalized regarless of length.
5+
is taken where all words are capitalized regardless of length.
66
*/
77

88
/**
@@ -12,7 +12,7 @@
1212
*/
1313
const titleCaseConversion = (inputString) => {
1414
if (inputString === '') return ''
15-
// Extact all space seprated string.
15+
// Extract all space separated string.
1616
const stringCollections = inputString.split(' ').map(word => {
1717
let firstChar = ''
1818
// Get the [ASCII](https://en.wikipedia.org/wiki/ASCII) character code by the use charCodeAt method.

Data-Structures/Linked-List/CycleDetection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function main () {
1111
Note:
1212
* While Solving the problem in given link below, don't use main() function.
1313
* Just use only the code inside main() function.
14-
* The purpose of using main() function here is to aviod global variables.
14+
* The purpose of using main() function here is to avoid global variables.
1515
1616
Link for the Problem: https://leetcode.com/problems/linked-list-cycle/
1717
*/

Data-Structures/Linked-List/RotateListRight.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function main () {
1010
Note:
1111
* While Solving the problem in given link below, don't use main() function.
1212
* Just use only the code inside main() function.
13-
* The purpose of using main() function here is to aviod global variables.
13+
* The purpose of using main() function here is to avoid global variables.
1414
1515
Link for the Problem: https://leetcode.com/problems/rotate-list/
1616
*/

Data-Structures/Tree/AVLTree.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ let utils;
3737
*/
3838
const AVLTree = (function () {
3939
function _avl (comp) {
40-
/** @public compartor function */
40+
/** @public comparator function */
4141
this._comp = undefined
4242
if (comp !== undefined) {
4343
this._comp = comp
@@ -119,7 +119,7 @@ const AVLTree = (function () {
119119
node._right = rightRotate(node._right)
120120
return leftRotate(node) // Right Left
121121
}
122-
return leftRotate(node) // Rigth Right
122+
return leftRotate(node) // Right Right
123123
}
124124
// implement avl tree insertion
125125
const insert = function (root, val, tree) {
@@ -202,7 +202,7 @@ const AVLTree = (function () {
202202
return true
203203
}
204204
/**
205-
* TO check is a particluar element exists or not
205+
* TO check is a particular element exists or not
206206
* @param {any} _val
207207
* @returns {Boolean} exists or not
208208
*/

0 commit comments

Comments
 (0)
X Tutup