File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
src/hackerrank/interview_preparation_kit/search Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 11/**
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]]
33 */
44
55import { Node } from '../../lib/Node.js' ;
66
77// 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 ;
1111const __RADIX__ = 10 ;
1212
13- export class Tree {
13+ class Tree {
1414 root ;
1515
1616 nodeCollector ;
@@ -97,7 +97,7 @@ export class Tree {
9797 }
9898}
9999
100- export function swapNodes ( indexes , queries ) {
100+ function swapNodes ( indexes , queries ) {
101101 const tree = new Tree ( indexes ) ;
102102 let nodeCollector = tree . getCollector ( ) ;
103103 const output = [ ] ;
@@ -126,4 +126,5 @@ export function swapNodes(indexes, queries) {
126126 return output ;
127127}
128128
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