Hie everybody, I am stuck with this portion of my assignment and desperately need your help.
please help me with this.
Thanks!!




  1. Write a program to implement insertion sort.


Your program should take as input a text file which contains numbers to be sorted and it should output a text file containing the sorted sequence and also output at each round of insertion sort. Both input and output files should be passed as command line arguments to your program as given in Sample Run.

eg.
Input file (input.txt)

23 15 45 19 20 27 31

Output file (output.txt)

23 15 45 19 20 27 31
15 23 45 19 20 27 31
15 23 45 19 20 27 31
15 19 23 45 20 27 31
15 19 20 23 45 27 31
15 19 20 23 27 45 31
15 19 20 23 27 31 45

Sample Run:
It assumes that your program is compiled into insertionSort.out executable and takes input.txt file as input and output.txt file as output.

./insertionSort.out input.txt output.txt