Rational Number (3)

  1. Sort this data set, which contains 100,000 rational numbers.
  2. Measure how long it takes to sort the array.
  3. Compare your result with your classmates. Whose sorting algorithm runs faster?
  4. The main function may look like this.
    int main()
    {
        Rational A[N];
        time_t start_time, end_time;
    
        read_rationals(A, N);
    
        time(&start_time);
        sort_rationals(A, N);
        time(&end_time);
        // print_rationals(A, N);
        printf("It takes %d seconds to sort %d rational numbers.\n",
            end_time - start_time, N);
    
        return 0;
    }