Skip to content

Commit d101a5c

Browse files
committed
fixed lint and tests
1 parent f295264 commit d101a5c

File tree

7 files changed

+7
-12
lines changed

7 files changed

+7
-12
lines changed

examples/PacktDataStructuresAlgorithms.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/PacktDataStructuresAlgorithms.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
},
5656
"devDependencies": {
5757
"@types/chai": "^4.1.2",
58-
"@types/mocha": "^5.2.0",
58+
"@types/mocha": "^5.0.0",
5959
"babel-cli": "^6.26.0",
6060
"babel-core": "^6.26.0",
6161
"babel-eslint": "^8.2.2",

src/js/algorithms/sorting/quicksort.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function partition(array, left, right, compareFn) {
44
const pivot = array[Math.floor((right + left) / 2)];
55
let i = left;
66
let j = right;
7-
7+
88
while (i <= j) {
99
while (compareFn(array[i], pivot) === Compare.LESS_THAN) {
1010
i++;

src/ts/algorithms/sorting/quicksort.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import { Compare, defaultCompare, ICompareFunction, swap } from '../../util';
22

3-
const partition = function(
4-
array: any[],
5-
left: number,
6-
right: number,
7-
compareFn: ICompareFunction<any>
8-
) {
3+
const partition = function(array: any[], left: number, right: number, compareFn: ICompareFunction<any>) {
94
const pivot = array[Math.floor((right + left) / 2)];
105
let i = left;
116
let j = right;

src/ts/others/balanced-symbols.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function parenthesesChecker(symbols: string) {
2020
top = stack.pop();
2121
if (!(opens.indexOf(top) === closers.indexOf(symbol))) {
2222
balanced = false;
23-
}
23+
}
2424
}
2525
}
2626
index++;

src/ts/others/fibonacci.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function fibonacciMemoization(n: number) {
2222
if (n < 1) { return 0; }
2323
const memo = [0, 1];
2424
const fibonacciMem = (num: number): number => {
25-
// if (memo[num] != null) { return memo[num]; }
25+
if (memo[num] != null) { return memo[num]; }
2626
return (memo[num] = fibonacciMem(num - 1) + fibonacciMem(num - 2));
2727
};
2828
return fibonacciMem(n);

0 commit comments

Comments
 (0)