daily log 9.13.20
UJS
Working on sinkDown
function sinkDown(array) {
// console.log(array)
let root_idx = 0;
let left_idx = root_idx + 1;
let right_idx = root_idx + 2;
while (root_idx < array.length - 2) {
console.log("getting here");
console.log(array[root_idx], array[left_idx], array[right_idx]);
root_idx = root_idx + 3;
}
return root_idx;
}
sinkDown([39, 19, 12, 11, 3, 4]);