Exercise: Quicksort
Create an exercise for the tutorial with the following parts:
-
struct list
with definition for linked list of integers void append(list_t*, list_t)
-
list_t partition(list_t* l, size_t pivot)
which stores elements <= pivot in the returned list and leaves the rest inl
-
void quicksort(list_t* l)
which uses the first element as pivot
Maybe structure the exercise in the following steps:
- Only safety, a la Rust
- The list after quicksort is sorted
- The resulting list is a permutation of the input list