File tree 4 files changed +7
-6
lines changed
4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
- import Stack from './../../src/js/data-structures/stack.js' ; // ES2015 modules
1
+ // import Stack from './../../src/js/data-structures/stack.js'; // ES2015 modules
2
2
// import StackArray from './../../src/js/data-structures/stack-array.js'; // ES2015 modules
3
3
// const Stack = require('../../dist/js/data-structures/stack'); // for node
4
4
// const Stack = stack; // older browsers - remove from html script import: type="module"
5
+ const { Stack } = PacktDataStructuresAlgorithms ;
5
6
6
7
const stack = new Stack ( ) ; // new StackArray();
7
8
Original file line number Diff line number Diff line change 1
- const parenthesesChecker = PacktDataStructuresAlgorithms . parenthesesChecker ;
1
+ const { parenthesesChecker } = PacktDataStructuresAlgorithms ;
2
2
3
3
console . log ( '{([])}' , parenthesesChecker ( '{([])}' ) ) ; // true
4
4
console . log ( '{{([][])}()}' , parenthesesChecker ( '{{([][])}()}' ) ) ; // true
Original file line number Diff line number Diff line change 1
- const decimalToBinary = PacktDataStructuresAlgorithms . parenthesesChecker ;
2
- const baseConverter = PacktDataStructuresAlgorithms . baseConverter ;
1
+ const { decimalToBinary } = PacktDataStructuresAlgorithms ;
2
+ const { baseConverter } = PacktDataStructuresAlgorithms ;
3
3
4
4
// 233 == 11101001
5
5
// 2x(10x10) + 3x(10) + 3x(1)
Original file line number Diff line number Diff line change 1
- const hanoiStack = PacktDataStructuresAlgorithms . hanoiStack ;
2
- const hanoi = PacktDataStructuresAlgorithms . hanoi ;
1
+ const { hanoiStack } = PacktDataStructuresAlgorithms ;
2
+ const { hanoi } = PacktDataStructuresAlgorithms ;
3
3
4
4
console . log ( hanoiStack ( 3 ) ) ;
5
5
You can’t perform that action at this time.
0 commit comments