Problem 44538. Arrange the names in alphabetical order (1)
Arrange the list of names in alphabetical order. The original 'alphabetical order', that is: from α and β all the way through to ω. We might call this 'alpha-beta-cal order'!
You do not need to heed the capitalisation (uppercase versus lowercase) in determining the correct sequence, although it must be preserved in your final output.
Accents or diacritics should not be heeded in determining the correct sequence, but should likewise be retained in the final output. This is consistent with some practice, albeit not universal. Only the 'tonos' will be present in the Test Suite (unless you try the optional Bonus Question).
Sorting should be based on the surname [family name], where present. The surname will always appear last, if present. In principle, if two surnames were alike, then one would have to next sort by the given name(s) [first name(s)] — however, that situation does not arise, and will not arise, in the Test Suite.
Inputs comprise cell arrays of character vectors. The cell arrays can be either row or column vectors. Return your output in the same type of vector.
EXAMPLE:
% Input in = {'Δημήτρης Δραγατάκης'; 'Ρίτα Αμπατζή'} % Output out = {'Ρίτα Αμπατζή'; 'Δημήτρης Δραγατάκης'}
Although Δ (delta, ~d) precedes Ρ (rho, ~r) in the Greek alphabet, we must sort first by surname, for which Α (alpha, ~a) precedes Δ (delta, ~d).
See also:
Solution Stats
Problem Comments
-
1 Comment
Test 2 (for kudos) is incorrect.
If Nu (~n) < Sigma (~s) then it should be:
Αἰνησίδημος
Αἰσάρα
Instead of:
Αἰσάρα
Αἰνησίδημος
Solution Comments
Show commentsProblem Recent Solvers8
Suggested Problems
-
1237 Solvers
-
Rotate input square matrix 90 degrees CCW without rot90
606 Solvers
-
Basics: 'Find the eigenvalues of given matrix
412 Solvers
-
Find the index of n in magic(n)
237 Solvers
-
359 Solvers
More from this Author32
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!