Frits van Bommel wrote: > Of course, if you're only concerned about malicious users sending > worst-case data (and not about worst-case data appearing randomly) > there's an easy fix: randomize the data in O(n) :). Yeah, sure. You can also just pick a random element per iteration (instead of the first one or the middle one).