Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #13277 > unrolled thread

sorting

Started byFrancisco Gutierrez <fgutiers2002@yahoo.com>
First post2013-01-26 06:38 +0000
Last post2013-01-26 06:38 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  sorting Francisco Gutierrez <fgutiers2002@yahoo.com> - 2013-01-26 06:38 +0000

#13277 — sorting

FromFrancisco Gutierrez <fgutiers2002@yahoo.com>
Date2013-01-26 06:38 +0000
Subjectsorting
Message-ID<kdvtkq$fp9$1@smc.vnet.net>
Dear Group:
I managed to solve the problem, but with a rather involved strategy.
Remember: the ratio between the first and the second part is the first sorting criterion, and the size of the second part is the second criterion.
First, use Gather to create clusters of sublists according to the first criterion.
Second, use Sort to order clusters within the big list according to the fist criterion
Then, with Map (or Table) order each cluster of lists according to the second criterion
Finally, Flatten the result at level 1.


It works ok, but i wonder if its efficient, and if there is not a much simpler way to do it

F

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web