You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Sorting algorithms arrange data into a specific order — usually ascending (smallest to largest) or descending (largest to smallest). In GCSE Computer Science, you must understand three sorting algorithms: bubble sort, merge sort, and insertion sort. You need to know how each works, trace through examples, and compare their efficiency.
Bubble sort works by repeatedly comparing adjacent pairs of items and swapping them if they are in the wrong order. The largest unsorted value "bubbles" to the end of the list after each pass. The algorithm repeats until no swaps are made in a complete pass.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.