What type of sort does the SORT function in MATLAB perform?

56 visualizaciones (últimos 30 días)
Could you tell me the algorithm and/or the running time of the SORT function?
I need to know which sorting algorithm is used by MATLAB when the SORT function is executed.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 27 de Jun. de 2009
Editada: MathWorks Support Team el 6 de Abr. de 2018
The type of sort that is done is a Quick Sort. It is not an 'adaptive sorting' algorithm, and does not deviate much from the standard Quick Sort algorithm. Quick Sort has been found to be one of the fastest algorithms for sorting; it is an O(n log n) operation. We do not have specific time information, since it depends on both the system and the numerical data used in the sort.

Más respuestas (0)

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by