File tree 1 file changed +8
-7
lines changed
src/hackerrank/interview_preparation_kit/search
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
- * @link Problem export functioninition [[docs/hackerrank/interview_preparation_kit/search/swap-nodes-algo.md]]
2
+ * @link Problem definition [[docs/hackerrank/interview_preparation_kit/search/swap-nodes-algo.md]]
3
3
*/
4
4
5
5
import { Node } from '../../lib/Node.js' ;
6
6
7
7
// CONSTANTS
8
- export const __INITIAL_LEVEL__ = 1 ;
9
- export const __ROOT_VALUE__ = 1 ;
10
- export const __LEAF_VALUE__ = - 1 ;
8
+ const __INITIAL_LEVEL__ = 1 ;
9
+ const __ROOT_VALUE__ = 1 ;
10
+ const __LEAF_VALUE__ = - 1 ;
11
11
const __RADIX__ = 10 ;
12
12
13
- export class Tree {
13
+ class Tree {
14
14
root ;
15
15
16
16
nodeCollector ;
@@ -97,7 +97,7 @@ export class Tree {
97
97
}
98
98
}
99
99
100
- export function swapNodes ( indexes , queries ) {
100
+ function swapNodes ( indexes , queries ) {
101
101
const tree = new Tree ( indexes ) ;
102
102
let nodeCollector = tree . getCollector ( ) ;
103
103
const output = [ ] ;
@@ -126,4 +126,5 @@ export function swapNodes(indexes, queries) {
126
126
return output ;
127
127
}
128
128
129
- export default { swapNodes, __INITIAL_LEVEL__ } ;
129
+ export default { swapNodes, Tree, __INITIAL_LEVEL__ } ;
130
+ export { swapNodes , Tree , __INITIAL_LEVEL__ } ;
You can’t perform that action at this time.
0 commit comments