Skip to content

Commit 685a03f

Browse files
authoredApr 25, 2018
Merge pull request loiane#73 from loiane/third-edition
Third edition
2 parents 19b2cab + d101a5c commit 685a03f

9 files changed

+1656
-3369
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.

‎examples/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<div class="page-content mdl-layout--fixed-drawer">
6767
<div class="mdl-layout__drawer is-visible">
6868
<nav class="mdl-navigation">
69-
<a class="mdl-navigation__link" href="chapter01_02_02/01-HelloWorld.html">01-HelloWorld</a>
69+
<a class="mdl-navigation__link" href="chapter01_02/01-HelloWorld.html">01-HelloWorld</a>
7070
<a class="mdl-navigation__link" href="chapter01_02/02-Variables.html">02-Variables</a>
7171
<a class="mdl-navigation__link" href="chapter01_02/03-Operators.html">03-Operators</a>
7272
<a class="mdl-navigation__link" href="chapter01_02/04-TruthyFalsy.html">04-Truthy Falsy</a>

‎package-lock.json

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

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"generate-report2": "nyc --report-dir coverage npm run test",
3232
"go": "npm run clean && npm run lint && npm run build && npm run test",
3333
"webpack": "webpack --env build",
34-
"serve" :"http-server"
34+
"serve": "http-server"
3535
},
3636
"nyc": {
3737
"include": [
@@ -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/util.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function biggerEquals<T>(a: T, b: T, compareFn: ICompareFunction<T>) {
2424

2525
export function defaultCompare<T>(a: T, b: T): number {
2626
if (a === b) {
27-
return 0;
27+
return Compare.EQUALS;
2828
}
2929
return a < b ? Compare.LESS_THAN : Compare.BIGGER_THAN;
3030
}

0 commit comments

Comments
 (0)
Please sign in to comment.