Eg.an array A[5]={5,1,4,2,8} 0,1,2,3,4 PASS 1: i=0 //range of i={0,1,2,3} //for i=0 to n-2 j=0 //range of j={0,1,2,3} //for j=0 to n-2-i 1<5 //A[j+1]<A[j] Swap 1 and 5, //swap A[j] and A[j+1] //List becomes 1,5,4,2,8 j=1 , 4<5 ,swap 4 and 5 // list becomes 1,4,5,2,8 j=2 , 2<5 ,swap 2 and 5 // list becomes 1,4,2,5,8 j=3, 8<5 // list remains 1,4,2,5,8