필터 지우기
필터 지우기

Best sorting algorithm for large array

조회 수: 7 (최근 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 CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by