This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use strict"; | |
| class TreeNode { | |
| data; | |
| left; | |
| right; | |
| constructor(data) { | |
| this.data = data; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use strict"; | |
| class TreeNode { | |
| data; | |
| left; | |
| right; | |
| constructor(data) { | |
| this.data = data; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use strict"; | |
| const Mocha = require('mocha'); | |
| const {describe, it} = Mocha; | |
| const chai = require('chai'); | |
| const {assert} = chai; | |
| chai.should(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use strict"; | |
| const Heap = require("heap"); | |
| class Trie { | |
| count = 0; | |
| key = null; | |
| // each node stores a map to its child nodes | |
| character = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use strict"; | |
| const Heap = require("heap") | |
| const input = [ | |
| [3, 6, 8, 10 , 15], | |
| [1, 5, 12], | |
| [4, 8, 15, 16], | |
| [2, 6] | |
| ] |
OlderNewer