Quick actions

cmd+k|ctrl+k

Navigation

Languages

1.bubble sort

Snippet info

Language

Python

Visibility

public

Author

sriram

Created

2025-04-27T09:29:32.903489Z

Updated

2025-04-27T09:29:41.220622Z

def bubble(a):
    for i in range(len(a)):
        for j in range(0, len(a) - i - 1):  
            if a[j] > a[j + 1]:         
                a[j], a[j + 1] = a[j + 1], a[j]  

a = [5, 3, 7, 6, 8]
bubble(a)
print(a)
INFO