Write a program that checks if a sort being used is stable (Use function pointer to pass the function of the sort routine).
For example,
1. I have an array of ints (4, 5, 6, 5, 4, 6)
2. You assign each int with a particular ID.
Array (4, 5, 6, 5, 4, 6)
ID (1, 2, 3, 4, 5, 6)
The first element, which is four, is assigned with ID 1.
The second element, which is five, is assigned with ID 2.
and so on.......
3. Sort the array.
Array (4, 4, 5, 5, 6, 6)
ID (1, 5, 2, 4, 3, 6)
This sort is stable because
First int 4's ID (1) < second int 4's ID (5)
First int 5,s ID (2) < second int 5's ID (4)