Selection Sort

Roshan Kumar Sah
Dev Genius
Published in
Apr 3, 2021

--

In computer science, selection sort is an in-place comparison sorting algorithm. It has an O(n2) time complexity, which makes it inefficient on large lists, and generally performs worse than the similar insertion sort. Selection sort is noted for its simplicity and has performance advantages over more complicated algorithms in certain situations, particularly where auxiliary memory is limited.

Selection Sort:

var unOrderArray = [4,2,6,10,8]
Suppose we have array of unordered numbers(In this case even number, subset of natural numbers)
We have two option to sort this.
1. Ascending order.
2. Descending order.
Selection Sort(Ascending Order)

Thanks for reading.
Please let me know if you have any queries or doubt or suggestion

roshankumar350@gmail.com
Roshan kumar Sah.

--

--