function populate(lo,hi, depth) { if (lo >= hi) return; if (depth > MAX_DEPTH) return; midpoint = rand(lo,hi); add_to_result(midpoint); populate(lo, midpoint-1, depth+1); populate(midpoint+1, hi, depth+1); }