Paked - How to write a bubble sort algorithm?


How to write a bubble sort algorithm?

Procedure BubbleSort (num 1, ...num n )

for i = 1 to n - 1

for j = 1 to n - i

if num j > num j+1, then interchange num j  and num j+1


{num j,... num n  is in increasing order}

Your Answer




DISCLAIMER

Paked and the contributors are not responsible for any errors contained and are not liable for any damages resulting from the use of this material.  

Disclaimer


Home | Disclaimer | Advertise| Contact| Privacy Policy

 

Copyright © 2004-10 Paked.com. All rights reserved.

Note: Site best viewed at 1024 x 768 or higher screen resolution