

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A bubble sort algorithm goes through a list of data a number of times, comparing two items that are side by side to see which is out of order. It will keep ...
Typology: Study notes
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Figure 1 Figure 2
1. for i in range len(arr): 2. if arr[i]>arr[i+1]: 3. temp = arr[i] 4. arr[i] = arr[i+1] 5. arr[i+1] = temp Figure 3