Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

bubble sort python

s= [1,2,3,4,5,6,7,8,9,10]
for i in range(len(s)-1):
    for j in range(len(s)-1-i):
        if s[j]>s[j+1]:
            s[j],s[j+1] = s[j+1],s[j]
print(s)
 
PREVIOUS NEXT
Tagged: #bubble #sort #python
ADD COMMENT
Topic
Name
5+4 =