2 ms·
Yes and with naïve median-finding comes pathological inputs that hit the worst case O(n^2). Something to watch out for if you’re sorting user-provided input as
by chongli 4y ago
Yes and with naïve median-finding comes pathological inputs that hit the worst case O(n^2). Something to watch out for if you’re sorting user-provided input as that could open you up to some silly denial of service attacks!