Skip to content

Instantly share code, notes, and snippets.

@waieez
waieez / join.js
Last active July 7, 2017 22:00
HackerRank Join Question
var left = [
"apple",
"grape",
"grape",
"melon"
]
var right = [
"grape",
"lemon",
@waieez
waieez / ConstantSpaceDFSBST.js
Last active September 13, 2016 19:01
Elements
function Node(val, parent) {
return {parent: parent, val:val, left:null, right:null}
}
// Root
var two = Node(2, null)
// L
var one = Node(1, two)
two.left = one
var onefive = Node(1.5, one)
one.right = onefive
var V = ["A", "B", "C"]
var E = [
["A", "B", 3],
["A", "C", 10],
["B", "C", 5],
["C", "A", -8]
]
BF(V, E, "A")