Sorting algorithm substituting the prebuilt 'sort' function in MATLAB

1 Ansicht (letzte 30 Tage)
Gesh
Gesh am 20 Nov. 2016
Beantwortet: Prasad Mendu am 23 Nov. 2016
I am given a .mat file with 90+ countries (AUS,CAD,USA etc) and we are supposed to sort it alphabetically before we could use it for further processing. The problem is, I am not allowed to use a prebuilt sorting function. How should the sorting algorithm look like?
Thanks

Antworten (1)

Prasad Mendu
Prasad Mendu am 23 Nov. 2016
As Per Iskakson mentioned in the comments, you can start off with Bubble sort and then explore other sorting algorithms that have less time complexity.
Some useful links to look at:

Kategorien

Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by