Best sorting algorithm for large array
4 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
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
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!