Bubble Sort (3)

  1. You may wish to further enhance your bubble_sort() to make it even generic, so that it can handle both integers and rational numbers.
  2. Test your bubble_sort() with the following main() function:
    int main()
    {
        Rational A[N] = { {10, 9}, {8, 7}, {6, 5}, {4, 3}, {2, 1},
                          {1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10} };
        int B[N] = { 1, 3, 5, 7, 9, 2, 4, 6, 8, 10 };
    
        bubble_sort(A, N, sizeof(A[0]), cmp_rational);
        print_rationals(A, N);
    
        bubble_sort(B, N, sizeof(B[0]), cmp_integer);
        print_integers(B, N);
    
        return 0;
    }