Description
continustion of the explanation to the third round of the pass .
Presentation Transcript
Third round : Third round In the third round 3rd element is compared with 4th and 5th elements. Elements are interchanged ( swap ) whenever require Process is shown below
Third element 3 is compared with fourth element 5.
Since 5 > 3 , Hence Elements 3 and 5 are interchanged
25 , 20 , 3 , 5 , 15 [3rd element is compared with 4th ]
interchange 3 and 5
Status of the array : 25 , 20 , 5 , 3 , 15
Next , third elements 5 is compared with fifth element 15
Since 15 > 5 , Hence elements 5 an 15 are interchanged
25 , 20 , 5 , 3 , 15 [3rd element is compared with 4th ]
interchange 5 and 15
Array Status : 25 , 20 , 15 , 3 , 5 [3rd largest has taken
the third place ]
After the second round the second smallest element has come to the third position.
Your Facebook Friends on WizIQ