Image for post
Image for post

Walk-through: Selection Sort Algorithm

How do you sort?

Selection Sort Algorithm

Selection Sort Pseudocode

SelectionSort(arr) DECLARE n <-- arr.length; FOR i to n - 1 DECLARE min <-- i FOR j is i + 1 to n if (arr[j] < arr[min]) min <-- j DECLARE temp <-- arr[min] arr[min] <-- arr[i] arr[i] <-- temp

Walkthrough

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Complexity Analysis

Summary

Learn to Code. Get a Job. Start Here! Learn more at www.codefellows.org

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store