Skip to content

Sorting Notes:

  • Bubble sorting is when you iterate over each index of an array, compare adjacent elements, and swap accordingly. Repeating the cycle until no swaps occur.
  • Insertion sorting is when you iterate over each index of an array, and while the element at an index is less than the one before it, swap the elements. Essentially pushing each element as far back as possible.
  • Selection sortingis when you iterate over each index of an array. At each index, check every element at and after the current index, find the index of the smallest element. Swap the element with the smallest element with the element at the current index.