while merging two sorted array of size m,n respectively why total number of comparision is m+n-1?.

suppose

1st list contain 2,3

2nd list containn 4,5,6

insert infinity in first list at end and infinity in second list at end.

1st comparison of (2,4) ----------->2 will come in Final Array

2nd comparison of (3,4) ----------->3 will come in Final Array

3rd comparison of (infinity, 4)----------->4 will come in Final Array

4th comparison of (infinity,5)----------->5 will come in Final Array

5th comparison of (infinity,6)----------->6 will come in Final Array

so according to above procedure there will be total of m+n comparision i.e here 5.