Skip to content

Third edition #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 25, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixed lint and tests
  • Loading branch information
loiane committed Apr 25, 2018
commit d101a5c5afbab508e1f0e6ecf52f0e784e167b47
2 changes: 1 addition & 1 deletion examples/PacktDataStructuresAlgorithms.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/PacktDataStructuresAlgorithms.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"devDependencies": {
"@types/chai": "^4.1.2",
"@types/mocha": "^5.2.0",
"@types/mocha": "^5.0.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.2",
Expand Down
2 changes: 1 addition & 1 deletion src/js/algorithms/sorting/quicksort.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function partition(array, left, right, compareFn) {
const pivot = array[Math.floor((right + left) / 2)];
let i = left;
let j = right;

while (i <= j) {
while (compareFn(array[i], pivot) === Compare.LESS_THAN) {
i++;
Expand Down
7 changes: 1 addition & 6 deletions src/ts/algorithms/sorting/quicksort.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { Compare, defaultCompare, ICompareFunction, swap } from '../../util';

const partition = function(
array: any[],
left: number,
right: number,
compareFn: ICompareFunction<any>
) {
const partition = function(array: any[], left: number, right: number, compareFn: ICompareFunction<any>) {
const pivot = array[Math.floor((right + left) / 2)];
let i = left;
let j = right;
Expand Down
2 changes: 1 addition & 1 deletion src/ts/others/balanced-symbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function parenthesesChecker(symbols: string) {
top = stack.pop();
if (!(opens.indexOf(top) === closers.indexOf(symbol))) {
balanced = false;
}
}
}
}
index++;
Expand Down
2 changes: 1 addition & 1 deletion src/ts/others/fibonacci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function fibonacciMemoization(n: number) {
if (n < 1) { return 0; }
const memo = [0, 1];
const fibonacciMem = (num: number): number => {
// if (memo[num] != null) { return memo[num]; }
if (memo[num] != null) { return memo[num]; }
return (memo[num] = fibonacciMem(num - 1) + fibonacciMem(num - 2));
};
return fibonacciMem(n);
Expand Down