















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















Selection Sort Example: 30 49 26 13 55 36 So 13 is the smallest element and placed it in first position
Pass 1:
Pass 3: Pass 4:
Pass 5:
Pass 1: A[0] by itself sorted. Pass 2: A[1] is inserted before or after A[0], so that A[0], A[1] are to be sorted. Pass 3: A[2] is inserted into its proper place in A[0], and A[1] before A[0], between A[0] and A[1], or after A[1], so that A[0], A[1], A[2] are to be sorted. Pass N: A[n-1] is inserted into its proper place in A[0], A[1], A[2]... A[n-1] so that they are to be sorted.
Pass 1
Pass 2
Pass 3 Pass 4 (^) 17 15 15 17 15 17 35 37 49