daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. template <typename T>
  2. Node<T>* sort2n(Node<T>** x, int n) {
  3.   // Take a single element
  4.   Node<T>* sorted = take1(x);
  5.  
  6.   for (int i = 0; *x && i < n; ++i) {
  7.     // Merge in 2^i sorted elements.
  8.     merge(&sorted, sort2n(x, i));
  9.   }
  10.  
  11.   return sorted;
  12. }
RAW Paste Data
Top