in reply to Pick k numbers at random
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); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Pick k numbers at random
by Anonymous Monk on Nov 15, 2019 at 18:00 UTC |