Global Information Lookup Global Information

Selection sort information


Selection sort
ClassSorting algorithm
Data structureArray
Worst-case performance comparisons, swaps
Best-case performance comparisons, swap
Average performance comparisons, swaps
Worst-case space complexity auxiliary
OptimalNo
Preview warning: Page using Template:Infobox algorithm with unknown parameter "stable"

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.

The algorithm divides the input list into two parts: a sorted sublist of items which is built up from left to right at the front (left) of the list and a sublist of the remaining unsorted items that occupy the rest of the list. Initially, the sorted sublist is empty and the unsorted sublist is the entire input list. The algorithm proceeds by finding the smallest (or largest, depending on sorting order) element in the unsorted sublist, exchanging (swapping) it with the leftmost unsorted element (putting it in sorted order), and moving the sublist boundaries one element to the right.

The time efficiency of selection sort is quadratic, so there are a number of sorting techniques which have better time complexity than selection sort.

and 27 Related for: Selection sort information

Request time (Page generated in 0.8702 seconds.)

Selection sort

Last Update:

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...

Word Count : 1650

Insertion sort

Last Update:

e., O(n2)) sorting algorithms More efficient in practice than most other simple quadratic algorithms such as selection sort or bubble sort Adaptive, i...

Word Count : 2908

Sorting algorithm

Last Update:

exchange, selection, merging, etc. Exchange sorts include bubble sort and quicksort. Selection sorts include cycle sort and heapsort. Whether the algorithm is...

Word Count : 6394

Bubble sort

Last Update:

allowed, bubble sort sorts in O(n) time, making it considerably faster than parallel implementations of insertion sort or selection sort which do not parallelize...

Word Count : 2318

Sorting

Last Update:

for an out-of-order item, then insert the item in the proper place. Selection sort: Find the smallest (or biggest) element in the array, and put it in...

Word Count : 778

Heapsort

Last Update:

comparison-based sorting algorithm which can be thought of as "an implementation of selection sort using the right data structure." Like selection sort, heapsort...

Word Count : 5718

Cocktail shaker sort

Last Update:

shaker sort, also known as bidirectional bubble sort, cocktail sort, shaker sort (which can also refer to a variant of selection sort), ripple sort, shuffle...

Word Count : 1087

Quicksort

Last Update:

T(n)=O(n)+T(0)+T(n-1)=O(n)+T(n-1).} This is the same relation as for insertion sort and selection sort, and it solves to worst case T(n) = O(n2). In the most balanced...

Word Count : 9985

Tournament sort

Last Update:

Tournament sort is a sorting algorithm. It improves upon the naive selection sort by using a priority queue to find the next element in the sort. In the...

Word Count : 1682

Merge sort

Last Update:

computer science, merge sort (also commonly spelled as mergesort) is an efficient, general-purpose, and comparison-based sorting algorithm. Most implementations...

Word Count : 6747

Bucket sort

Last Update:

be used as well, such as selection sort or merge sort. Using bucketSort itself as nextSort produces a relative of radix sort; in particular, the case...

Word Count : 2190

Partial sorting

Last Update:

includes a PartialQuickSort algorithm used in partialsort! and variants. Selection algorithm Conrado Martínez (2004). On partial sorting (PDF). 10th Seminar...

Word Count : 952

Selection algorithm

Last Update:

as an extreme case, selection in an already-sorted array takes time O ( 1 ) {\displaystyle O(1)} . An algorithm for the selection problem takes as input...

Word Count : 5704

Online algorithm

Last Update:

optimization. As an example, consider the sorting algorithms selection sort and insertion sort: selection sort repeatedly selects the minimum element from...

Word Count : 703

Introsort

Last Update:

selection algorithm is to take the first or the last element of the list as the pivot, causing poor behavior for the case of sorted or nearly sorted input...

Word Count : 1080

Internal sort

Last Update:

internal sorting algorithms include: Bubble Sort Insertion Sort Quick Sort Heap Sort Radix Sort Selection sort Consider a Bubblesort, where adjacent records...

Word Count : 305

Pancake sorting

Last Update:

pancake sorting algorithm performs at most 2n − 3 flips. In this algorithm, a kind of selection sort, we bring the largest pancake not yet sorted to the...

Word Count : 2303

Priority queue

Last Update:

congruent to sorting algorithms. The section on the equivalence of priority queues and sorting algorithms, below, describes how efficient sorting algorithms...

Word Count : 4656

Comparison sort

Last Update:

comparison sorts include: Quicksort Heapsort Shellsort Merge sort Introsort Insertion sort Selection sort Bubble sort Odd–even sort Cocktail shaker sort Cycle...

Word Count : 2635

Integer sorting

Last Update:

queue in selection sort leads to the heap sort algorithm, a comparison sorting algorithm that takes O(n log n) time. Instead, using selection sort with a...

Word Count : 4038

NFL draft

Last Update:

League draft, also called the NFL draft or (officially) the Annual Player Selection Meeting, is an annual event which serves as the most common source of...

Word Count : 10905

Big O notation

Last Update:

works by first calling a subroutine to sort the elements in the set and then perform its own operations. The sort has a known time complexity of O(n2),...

Word Count : 8286

Time complexity

Last Update:

"efficient", or "fast". Some examples of polynomial-time algorithms: The selection sort sorting algorithm on n integers performs A n 2 {\displaystyle An^{2}} operations...

Word Count : 4969

Quickselect

Last Update:

selection algorithm to find the kth smallest element in an unordered list, also known as the kth order statistic. Like the related quicksort sorting algorithm...

Word Count : 1163

List of algorithms

Last Update:

the list Selection sort: pick the smallest of the remaining elements, add it to the end of the sorted list Smoothgamersort Other Bitonic sorter Pancake...

Word Count : 7843

Algorithmic efficiency

Last Update:

important. For example, bubble sort and timsort are both algorithms to sort a list of items from smallest to largest. Bubble sort sorts the list in time proportional...

Word Count : 3288

Glossary of computer science

Last Update:

comparison-based sorting algorithm. Heapsort can be thought of as an improved selection sort: like that algorithm, it divides its input into a sorted and an unsorted...

Word Count : 23790

PDF Search Engine © AllGlobal.net