324. Wiggle Sort II

Description

Here

Intuition

find the median value and do the dutch flag partition

For the quick selection of the kth element, check here

Then, we can using virtual index to do a sorting. The dutch flag partition problem, check 75. Sort Colors

Pitfall

Solution

Reference

results matching ""

    No results matching ""