Regarding the bubble sort

what will be about the 10th array, how it wil get sorted then if we take only 9 arrays

@ssmit_joshi, by arrays i think you mean by iterations , see what happens is at ith iteration we are sure that (i+1) elements from last are placed in correct place in sorted array ,
your outer loop is for (i = 0; i < n-1; i++)
lets take the last value i will take i.e i=n-2
now we are sure that (n-2+1)=(n-1) elements are placed correctly ,
so only one elements remain now , so it will be automatically placed correctly , as it has only one place it can go , eg :- arr=[5 4 3 2 1], if we place n-1=5-1=4 elements in their correct place in sorted order , we get arr=[1 2 3 4 5] , notice we placed only 4 element in their correct place 1 automatically got into the correct position

ask me any doubt you have in this