#include #include #include #include #include #include "quicksort.h" #include "array_tools.h" // You decide what the threshold will be #define USE_INSERTION_SORT 5 typedef struct { array_t array; size_t a; size_t c; } array_interval_t; typedef struct{ array_interval_t interval; unsigned char priority; } qsort_task_parameters_t; void insertion_sort( array_interval_t interval ) { // Your implementation here } __task void quick_sort_task( void* void_ptr){ // Your implementation here } void quicksort( array_t array ) { array_interval_t interval; qsort_task_parameters_t task_param; // Based on MTE 241 course notes--you can change this if you want // - in the course notes, this sorts from a to c - 1 interval.array = array; interval.a = 0; interval.c = array.length; task_param.interval = interval; // If you are using priorities, you can change this task_param.priority = 10; //start the quick_sort threading os_tsk_create_ex( quick_sort_task, task_param.priority, &task_param ); }