Best sorting algorithm for large array

5 ビュー (過去 30 日間)
Gonçalo Ferreira
Gonçalo Ferreira 2018 年 12 月 26 日
コメント済み: Gonçalo Ferreira 2018 年 12 月 27 日
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

回答 (1 件)

ahmed nebli
ahmed nebli 2018 年 12 月 27 日
I suggest you just use the command sort, see this link: https://www.mathworks.com/help/matlab/ref/sort.html
  1 件のコメント
Gonçalo Ferreira
Gonçalo Ferreira 2018 年 12 月 27 日
I can't use the sort command, i think it counts as a built-in function

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

Translated by