LongestIncreasingSubsequence-2x2

Patience sorting deal all cards using greedy

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: og n) time. Patience sorting. Deal all cards using greedy algorithm; repeatedly remove ・Use n stacks to represent n piles. ・Use binary search to find leftmost legal pile. smallest card. Theorem. For uniformly random deck, the expected number of piles is approximately 2 n 1/2 and the standard deviation is approximately n 1/6. PATIENCE (n, c1, c2, …, cn) Remark. An almost-trivial O(n3/2) sorting algorithm. _______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________...
View Full Document

Ask a homework question - tutors are online