Messages
Topics
Lists
Groups
Marketplace
Jobs
Mathew Ssebatta
2 years ago
In computer science, selection sort is an in-place comparison sorting algorithm. It has an O(_n_2) 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.
#programming #sorting-algorithms #selection-sort #swift
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.