← BYTES
Algorithms·Starter·Ref: 12.1.13
What is selection sort's basic approach to sorting an array?
Have a question about this video? Mention reference 12.1.13 when you contact us.
a.Build a binary search tree and read it back in order
b.Randomly shuffle elements until they happen to be sorted
c.Repeatedly find the minimum (or maximum) remaining element and swap it into its correct position at the front of the unsorted portion
d.Compare every pair of elements simultaneously in parallel
Selection sort repeatedly scans the unsorted remainder of the array to find the smallest element, then swaps it into place at the boundary between the sorted and unsorted portions -- simple to understand, but O(n^2) in every case since it always scans the full remaining unsorted portion regardless of how nearly sorted the input already is.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES12113#Algorithms