RosettaCodeData/Task/Sort-an-array-of-composite-structures/00-TASK.txt
2023-07-01 13:44:08 -04:00

22 lines
561 B
Text

{{Sorting Algorithm}}
[[Category:Sorting]]
Sort an array of composite structures by a key.
For example, if you define a composite structure that presents a name-value pair (in pseudo-code):
Define structure pair such that:
name as a string
value as a string
and an array of such pairs:
x: array of pairs
then define a sort routine that sorts the array ''x'' by the key ''name''.
This task can always be accomplished with [[Sorting Using a Custom Comparator]].
If your language is not listed here, please see the other article.
<br><br>