Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 971 Bytes

Explained.md

File metadata and controls

22 lines (14 loc) · 971 Bytes

Sorting Algorithms in Java and Python


1. Bubble Sort

  1. Explained
  • We have an array that we loop thought it and check in every 2 indexes witch is the smaller. When we have found the smaller we are swapping it with the higher and we keep swapping until we have a sorted array

2. Selection Sort

  1. Explained
  • In Selection Sort we loop though the given array and after we did that we have to find the smallest number in the array when found we swap the places of the list[0] and the place we found our lowest number and we keep gooing on until we have a sorted array

3. Insertion Sort

  1. Explained
  • Its like we sort card in our hand we have the first one and sorting it starting from the first card. Assigning a key and we start comparing the key to the elements until the element is smaller than the it found. When found we swap it and assign the key to bigger number than the number we have sorted