❮ Previous Next ❯

Python Bubblesort Program


def bubbleSort(numbers):

   length=len(numbers)

for i in range(length):

for j in range(0,length-i-1):

   if(numbers[j]>numbers[j+1]):


   temp=numbers[j]

   numbers[j]=numbers[j+1]

   numbers[j+1]=temp

numbers=[30,10,50,40,35,60]

bubbleSort(numbers)

print("sorted data items are:")

for i in range(len(numbers)):

print(numbers[i])

python BubbleSort program
❮ Previous Next ❯

Follow Us




  Tutorials

Popular Links

Contact Us

address Plot No-741,2ND Floor
Opp. Bhagabati Temple,Jayadev Vihar
      Bhubaneswar-751013
      Email: info@silantechnology.com
      Phone: 0674-2361252
address
39877, sundale dr, apt#101, Fremont, California 94538, USA
       Phone: +1(262)388-7619

facebook twitter google linked in

© 2018 Silan Technology. All Rights Reserved