Description
continuation of the process to the fourth round.
Presentation Transcript
Fourth Round : Fourth Round In the fourth round the fourth element is compared with fifth element. Elements are interchanged if require.
Here, the fourth element 3 is compared with the fifth element 5.
Since 5 >3 , Hence elements 3 and 5 are interchanged.
25 , 20 , 15 , 3 , 5 [4th element is compared with 5th ]
interchange 3 and 5
Array status : 25 , 20 , 15 , 5 , 3 [ Array Is Sorted ]
Observation :
Inside every round of sorting i.e. in ith round comparison of
i th element begins from ( i+1 ) th element .
[1st round : 1st element with 2nd , 3rd , 4th, and 5th elements ]
[2nd round : 2nd element with 3rd , 4th , and 5th elements ]
[ 3rd round : 3rd element with 4th , and 5th elements ]
and in the
[4th round : 4th element with 5th element ]
Your Facebook Friends on WizIQ