Hacker News new | ask | show | jobs
by NetMageSCW 265 days ago
How do you decide which weight to use to create two halves?
2 comments

You use a value called a pivot, not a weight, and there are many ways and endless variations you can read about, including just choosing a random value from the current range.
In their example they choose a random pivot, is that what you're asking about?

There are a number of strategies but random will indeed work and is simple to explain.