Question: Assignment Statement The students have to implement insertion sort and selection sort algorithms and then test their performance using any online C compiler. After the
Assignment Statement The students have to implement insertion sort and selection sort algorithms and then test their performance using any online C compiler. After the students have coded the algorithms, it should be tested for how long each sorting algorithm takes to run for both random array and sorted array. The testing conditions are below 1. Test for sorted array of size 1000 and 100000 (fill array using a simple for loop) 2. Test for unsorted array of size 1000 and 100000 (fill array using use rand() function) Notes: a. Use microsecond to print time. The below functions help to get time in microseconds /** Returns the current time in microseconds. */ long getMicrotime()? struct timeval currentTime; gettimeofday(\¤tTime, NULL); return currentTime.tv_sec * (int)1e6+ currentTime.tv_usec; ? b. Online compiler example, https://www.onlinegdb.com/online c compiler
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
