RosettaCodeData/Task/Sort-an-array-of-composite-structures/00DESCRIPTION
2016-12-05 22:15:40 +01:00

17 lines
510 B
Text

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>