Difference between revisions of "4.1"

From The Algorithm Design Manual Solution Wiki
Jump to navigation Jump to search
(Created page with "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)...")
 
 
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 algorithm.  The bottom half is one team, the top half the other.
  
Or much better , partition it with median as pivot . Time complexity O(n).
+
Or much better, partition it with median as pivot. Time complexity O(n).
  
  
Back to [[Chapter 3]]
+
Back to [[Chapter 4]]

Latest revision as of 18:20, 20 September 2020

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

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


Back to Chapter 4