Sorting
4 articles- Bubble Sort★★
Bubble sort is a simple sorting algorithm that repeatedly swaps adjacent items that are in the wrong order. It is a great first algorithm to study because its logic is easy to follow step by step.
- Insertion Sort★★★
Insertion sort builds a sorted list one item at a time by inserting each new item into its correct position among the already-sorted items. It works especially well on small or nearly-sorted lists.
- Selection Sort★★
Selection sort finds the smallest item in the unsorted portion of a list and moves it into place, one item at a time. It is easy to understand and always makes the same number of comparisons.
- Sorting Algorithms★★
Sorting algorithms arrange a list of items into a defined order. Understanding how they work helps you choose the right one for a given task.