The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: sorting
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Francisco Gutierrez

Posts: 102
Registered: 5/31/05
Posted: Jan 26, 2013 1:38 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.