Difference between revisions of "TADM2E 4.1"

From Algorithm Wiki
Jump to: navigation, search
(Recovering wiki)
 
(Undo revision 769 by FuckYou (talk))
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
Sort it with your favorite nlogn sorting algo.  The bottom half is one team, the top half the other.
 
Sort it with your favorite nlogn sorting algo.  The bottom half is one team, the top half the other.
 +
 +
Or much better , partition it with median as pivot . Time complexity O(n).

Latest revision as of 14:25, 23 July 2020

Sort it with your favorite nlogn sorting algo. The bottom half is one team, the top half the other.

Or much better , partition it with median as pivot . Time complexity O(n).