Question: Question 1 Sorting algorithms Write a C program to implement selection and quick algorithms. It requires a header program mysort.h containing function headers of the

 Question 1 Sorting algorithms Write a C program to implement selection

Question 1 Sorting algorithms Write a C program to implement selection and quick algorithms. It requires a header program mysort.h containing function headers of the following specifications, and mysort.c which implements the functions. Define an enumeration type named BOOLEAN with name false as O and true as 1. / This function tests if array a[n] is sorted in increasing order between index left and right, and returns true if yes, otherwise false. BOOLEAN is_sorted int *a, int left, int right); This function sorts the elements of int array *a from index left to right in increasing order, using the selection sort algorithm. void select_sort(int *a, int left, int right); This function sorts the elements of int array ta from index left to right in increasing order, using the quick sort algorithm. void quick_sort(int *a, int left, int right); This function swaps the values at referenced locations. It is an auxiliary function for the sorting functions. */ vaid swap int **, int *y); Use the provided testing program mysort_main.c to test your program. Note that the time measuring numbers vary with system and runtime. Public test gcc mysort. mysort_main.c - q1 q1 Algorithm correctness testing: Algorithm correctness testing: a[]:3,1,4,5,2,7,6,9,8, is_sorted(a) 10 Selection sort:1,2,3,4,5,6,7,8,9, is_sorted(b):1 Quick sort:1,2,3,4,5,6,7,8,9, is_sorted(b):1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!