5 Quick Sort + Partition

1 Sorting模板

912 Sort an Array

L31 Partition Array

L373 Partition Array by Odd and Even

L49 Sort Letters by Case

345 Reverse Vowels of a String

125 Valid Palindrome (L415)

75 Sort colors - 3 way patition (L148) - 可以counting sort或者3路归并

L399 Nuts & bolts Problem

917 Reverse Only Letters

other related:

L143 Sort Colors II - 用rainbow sort就会像多次3 way partition ?

86 Partition List (L96) - 这个其实不太像partition,不过写着partition所以加到了,比较像linkedlist普通操作

280 Wiggle Sort

324 Wiggle Sort II

Quick Select :

L5 Kth Largest Element (215) --- 相关703 用heap

L606 Kth Largest Element II - same as above

414 Third Maximum Number -- 可用变量来存,不是特别通用but O(n)

747 Largest Number At Least Twice of Others -- 这题与上一题一样,自己用变量存,其实还真有这类题目。

334 Increasing Triplet Subsequence 这题跟上一题414的解法很像,很容易想复杂。

L80 Median - 可以用divide & conquer, 可以用quick select too ?

Last updated