This document discusses different types of sorting algorithms:
- Sorting algorithms rearrange elements in a list into non-decreasing order by comparing elements. The main types are bubble sort, selection sort, insertion sort, merge sort, quick sort, and heap sort.
- Bubble sort works by comparing adjacent elements and swapping them if out of order, making multiple passes through the list. Selection sort selects the smallest element and moves it to the front on each pass. Insertion sort splits the list into sorted and unsorted parts, inserting unsorted elements into the sorted part.
- Merge sort divides the list into halves and iteratively merges the sorted halves. Quicksort chooses a pivot element and partitions the list into sub-lists based on