comp.lang.ada
 help / color / mirror / Atom feed
* multidimensional sort
@ 2020-03-17 12:31 Gilbert Gosseyn
  2020-03-17 12:56 ` Petter Fryklund
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Gilbert Gosseyn @ 2020-03-17 12:31 UTC (permalink / raw)


I want to sort an n-dim array by ascending dimensions and ascending elements as keys, in Ada. For example:
consider an array with n = 5 like:

((5, 8, 21, 37, 46), (5, 7, 12, 19, 26),
 (10, 12, 19, 33, 44), (7, 8, 34, 36, 38), (5, 11, 12, 27, 32), (10, 
  16, 30, 41, 45), (10, 13, 19, 40, 45), (10, 11, 18, 32, 41), (11, 
  28, 34, 37, 38))

which shall become

((5, 7, 12, 19, 26), (5, 8, 21, 37, 46), (5, 11, 12, 27, 32), (7, 8, 
  34, 36, 38), (10, 11, 18, 32, 41), (10, 12, 19, 33, 44), (10, 13, 
  19, 40, 45), (10, 16, 30, 41, 45), (11, 28, 34, 37, 38))

How to store, how to sort, and how to deallocate the original?

Thank you for your advice.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-17 20:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-17 12:31 multidimensional sort Gilbert Gosseyn
2020-03-17 12:56 ` Petter Fryklund
2020-03-17 17:24   ` Simon Wright
2020-03-17 20:16     ` Simon Wright
2020-03-17 16:08 ` Jeffrey R. Carter
2020-03-17 17:10 ` Optikos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox