Nothing special here. It’s just a blog post for summarising my algorithm learning course. Although this was already taught in the University, I didn’t even know that it can be used for Selection Problem

# Selection Problem

Given an array of N items, find a k^{th} smallest item. For example, an array A =
`[5, 2, 9, 4, 10, 7]`

, the 3rd smallest item is `5`

, the 2nd smallest item is `4`

and the smallest
item is `2`

# The idea

- Based on Quick Sort
- Partition the array so that
- Entry
`a[j]`

is in place. - No larger entry to the left of
`j`

- No smaller entry to the right of
`j`

- Entry
- Repeat in one sub-array, depending on
`j`

, finished when`j`

equals`k`