Write a c++ template to sort an array using the ping-pong
sort described in class. You should test your code with
a small (test) main(). Use several different types and sizes (N > 15)
in your examples - print out the sorted arrays within your
main code.
B. Now let's verify that the ping-pong sort appears to be O(n*n):
Modify your code so that it counts every comparison of
data versus data. (Only have to add a small piece of code)
Then write a main program that
1. Generates 1000 random integers and sorts them using
the ping-pong sort. Don't print out the numbers,
but do print out the total number of comparisons to
required to do the sort. The random numbers should be
between 1 and 200,000.
2. Generates 2000 random integers and sorts them Print
out the number of comparisons required.
3. Generates 4000 random numbers, sorts and prints the number of comparisons.
Continue like this, doubling the data size until you have
done 128,000 numbers.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
## Platform
c++