Quicksort in C
Learn C - C tutorial - c program example quick sort - C examples - C programs
Quicksort in C
- Quicksort is a Divide and Conquer algorithm.
- Quicksort is a comparison sort, meaning that it can sort items of any type for which a "less-than" relation is defined.
- Quicksort can operate in-place on an array, requiring small additional amounts of memory to perform the sorting.
- It picks an element as pivot and partitions the given array around the picked pivot.
- There are many different versions of quicksort that pick pivot in different ways.
- Always pick first element as pivot.
- Always pick last element as pivot (implemented below)
- Pick a random element as pivot.
- Pick median as pivot.