>Here DATA is an Array with N elements. This algorithm sorts the elements in DATA.">

Welcome visitor, you can Log In or Create an Account

Call us toll free: (+880) 1736276567

  • 0
  • Create an Account

Bubble Sort

2018-11-26 22:53:53 || 2 Comments

Rate this item

(1 Vote)

>1     Repeat Steps 2 and 3 for K = 1 to N-1

>2             Set PTR: =1  

>3             Repeat while PTR<=N-K 

>    (a) If DATA[PTR]>DATA[PTR+1], then:

>  Interchange DATA[PTR] and DATA[PTR+1]          [End of if structure]

>                (b) Set PTR: =PTR+1

>             [End of inner loop]

>      [End of Step 1 Outer loop]

>4     Exit


Share this:


2 Comments

saif - 2018-12-18 13:42:43
Vlo lage nai
Nasif - 2018-12-18 13:43:21
Ki sob vhul val

Add Comment