This file contains 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
stop all containers: | |
docker kill $(docker ps -q) | |
remove all containers | |
docker rm $(docker ps -a -q) | |
remove all docker images | |
docker rmi $(docker images -q) |
This file contains 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
class TNode { | |
constructor (value) { | |
this.value = value; | |
this.left = null; | |
this.right = null; | |
} | |
print (level=0) { |
This file contains 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
class TNode { | |
constructor (value) { | |
this.value = value; | |
this.left = null; | |
this.right = null; | |
} | |
print (level=0) { |
This file contains 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
// A - B, C | |
// B - X, | |
// C - T, W | |
class Node { | |
constructor(value) { | |
this.value = value; | |
this.children = []; | |
} |
This file contains 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
class Node { | |
constructor(value, parent) { | |
this.value = value; | |
this.parent = parent; | |
this.children = []; | |
} | |
add(child) { | |
this.children.push(child); |
This file contains 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
function traverse(node, level=0) { | |
let indent = ""; | |
for (let i = 0; i < level; i++) { | |
indent += "*"; | |
} | |
console.log(`${indent}${node.nodeName}`); | |
if (node.childNodes.length > 0 ){ | |
node.childNodes.forEach(traverse, level+1); | |
} | |
} |
This file contains 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
class TrieNode { | |
constructor (value, note="") { | |
this.value = value; | |
this.note = note; | |
this.children = new Array(26); | |
} | |
addChildNode (char, value=null) { | |
let index = char.charCodeAt(0) - 97; | |
this.children[index] = this.children[index] || new TrieNode(null, char); |
This file contains 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
class Node { | |
constructor(value) { | |
this.value = value; | |
this.children = []; | |
} | |
add(child) { | |
this.children.push(child); | |
} |
This file contains 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
class Node { | |
constructor(value) { | |
this.value = value; | |
this.children = []; | |
} | |
add(child) { | |
this.children.push(child); | |
} |
This file contains 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
class Node { | |
constructor(value) { | |
this.value = value; | |
this.children = []; | |
} | |
add(child) { | |
this.children.push(child); | |
} |