fixed some spellings

This commit is contained in:
Keshav Bohra
2021-10-05 12:49:23 +05:30
parent 199d2637cc
commit 1589263947
41 changed files with 80 additions and 80 deletions

View File

@ -11,7 +11,7 @@ function main () {
Note:
* While Solving the problem in given link below, don't use main() function.
* Just use only the code inside main() function.
* The purpose of using main() function here is to aviod global variables.
* The purpose of using main() function here is to avoid global variables.
Link for the Problem: https://leetcode.com/problems/linked-list-cycle/
*/

View File

@ -10,7 +10,7 @@ function main () {
Note:
* While Solving the problem in given link below, don't use main() function.
* Just use only the code inside main() function.
* The purpose of using main() function here is to aviod global variables.
* The purpose of using main() function here is to avoid global variables.
Link for the Problem: https://leetcode.com/problems/rotate-list/
*/

View File

@ -37,7 +37,7 @@ let utils;
*/
const AVLTree = (function () {
function _avl (comp) {
/** @public compartor function */
/** @public comparator function */
this._comp = undefined
if (comp !== undefined) {
this._comp = comp
@ -119,7 +119,7 @@ const AVLTree = (function () {
node._right = rightRotate(node._right)
return leftRotate(node) // Right Left
}
return leftRotate(node) // Rigth Right
return leftRotate(node) // Right Right
}
// implement avl tree insertion
const insert = function (root, val, tree) {
@ -202,7 +202,7 @@ const AVLTree = (function () {
return true
}
/**
* TO check is a particluar element exists or not
* TO check is a particular element exists or not
* @param {any} _val
* @returns {Boolean} exists or not
*/

View File

@ -14,7 +14,7 @@ function Trie () {
this.root = new TrieNode(null, null)
}
// Recursively finds the occurence of all words in a given node
// Recursively finds the occurrence of all words in a given node
Trie.findAllWords = function (root, word, output) {
if (root === null) return
if (root.count > 0) {
@ -79,11 +79,11 @@ Trie.prototype.remove = function (word, count) {
child = child.children[key]
}
// Delete no of occurences specified
// Delete no of occurrences specified
if (child.count >= count) child.count -= count
else child.count = 0
// If some occurences are left we dont delete it or else
// If some occurrences are left we dont delete it or else
// if the object forms some other objects prefix we dont delete it
// For checking an empty object
// https://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object