Borrar filtros
Borrar filtros

Best sorting algorithm for large array

7 visualizaciones (últimos 30 días)
Gonçalo Ferreira
Gonçalo Ferreira el 26 de Dic. de 2018
Comentada: Gonçalo Ferreira el 27 de Dic. de 2018
Hey! For my homework, I need to find the median of a greyscaled image without using any built-in function. I can sort the matrix using a bubble sorting algorithm. However, this process takes a long time for a 300x300 matrix. I would like to know the best algorithm for something of this dimensions.
I also checked some quicksort codes, but they were a function on itself, and I can't do that because my function does more than just sort and find the median.
If any of you can recommend a good sorting algorithm or can make a quicksort without being in a function, I would highly appreciate

Respuestas (1)

ahmed nebli
ahmed nebli el 27 de Dic. de 2018
I suggest you just use the command sort, see this link: https://www.mathworks.com/help/matlab/ref/sort.html
  1 comentario
Gonçalo Ferreira
Gonçalo Ferreira el 27 de Dic. de 2018
I can't use the sort command, i think it counts as a built-in function

Iniciar sesión para comentar.

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by