Sorting & Searching Algorithms HW
here is my hw for the sorting and searching algorithms team teach
Selection sorting
How it works:
- finds the smallest element (8), swaps it with the most leftmost element (42), end result is [8, 17, 29, 42, 35]
- finds the smallest element from the unsorted part (17), which is already in the correct position, end result is [8, 17, 29, 42, 35]
- finds the smallest element from the unsorted part (29), which is already in the correct position, end result is [8, 17, 29, 42, 35]
- finds the smallest element from the unsorted part (35), swaps it with 42, end result is [8, 17, 29, 35, 42]
- the last element is sorted so, [8, 17, 29, 35, 42]