logoalt Hacker News

adgjlsfhk1today at 1:59 PM1 replyview on HN

if you have decent (randomized) pivoting, you never hit the worst case or anything like it


Replies

SkiFire13today at 2:11 PM

You don't need randomized pivoting for this, there are deterministic ones like median of median that will also result in a O(nlogn) worst case.

Also note that with a randomized pivoting you _might_ hit a O(n^2) worst case, it's just that it's incredibly rare and cannot be forced by an attacker controlling your input, so for most practical purposes can be ignored.

show 1 reply