Over a million developers have joined DZone.

Selection Sort - C#

DZone's Guide to

Selection Sort - C#

· Web Dev Zone ·
Free Resource

Access over 20 APIs and mobile SDKs, up to 250k transactions free with no credit card required

Selection Sort - C#


Efficiency: O(n^2)

public int[] SelectionSort(int[] arr)


//1. Find min

//2. Swap it with first element

//3. Repeat starting from secong position onwards.

int _min = 0;

for (int i = 0; i

#1 for location developers in quality, price and choice, switch to HERE.

web dev ,c# ,code snippet

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}