Computer Science - Algorithms - Bubble sort - Bubble Sort Algorithm

4 steps. Step 1 'How It Works': Compare adjacent pairs. If left > right, swap them. After one full pass, largest element is at the end ('bubbled up'). Repeat for remaining unsorted portion. Step 2 'Code': def bubble_sort(arr): n = len(arr); for i in range(n-1): for j in range(n-1-i): if arr[j] > arr

Edodovivmagarwal
Computer Science - Algorithms - Bubble sort - Bubble Sort Algorithm
Log in

Preparing your experience...

Loading scripts and resources

Comments (0)

0/5000

Comments are reviewed before appearing publicly.

About this Experience

Computer Science - Algorithms - Bubble sort - Bubble Sort Algorithm

vivmagarwal
vivmagarwalJan 29, 2026

Description

4 steps. Step 1 'How It Works': Compare adjacent pairs. If left > right, swap them. After one full pass, largest element is at the end ('bubbled up'). Repeat for remaining unsorted portion. Step 2 'Code': def bubble_sort(arr): n = len(arr); for i in range(n-1): for j in range(n-1-i): if arr[j] > arr

Details

Computer ScienceAlgorithmsClass 10, Class 10, Grade 10, Stage 10, MYP Year 5

Engagement

10

Likes

0

Remixes

0

Comments