Skip to main content

Questions tagged [sorting]

Questions on the sorting/ordering functions of Mathematica (Sort, SortBy, Ordering, etc.).

1 vote
3 answers
102 views

How to sort the terms in a polynomial according to their degree?

I have the polynomial ...
youthdoo's user avatar
  • 251
4 votes
4 answers
206 views

How to tally a list of lists only by considering the first element of the sub list

We need to Tally a list of lists only by considering the first element of the sub lists and then sort the resulting list. As a simple example consider ...
SPJ's user avatar
  • 159
1 vote
0 answers
30 views

Can we find (and understand) the ordering functions used in the various output forms?

Can we use (and perhaps even understand) the sorting functions used in the various output forms (such as OutputForm, TraditionalForm, TeXForm, etc...). This is motivated by the fact that I would like ...
Kvothe's user avatar
  • 4,591
0 votes
2 answers
123 views

How to find curved line in image? [closed]

What's the best way to find smooth curves in an image? I can use EdgeDetect[] to generate a binary image with what looks to my human eye like two distinct smooth curves, and I can get the coordinates ...
David's user avatar
  • 101
2 votes
1 answer
75 views

How to write a^2 - a b + b^2 - a c - b c + c^2 has the form a^2 + b^2 + c^2 - a b - b c - c a?

I tried ...
vector's user avatar
  • 243
2 votes
1 answer
108 views

Fastest splitter?

Consider some dataset ...
John Taylor's user avatar
  • 5,887
8 votes
5 answers
296 views

Ordering with repeats

A quick question on list ordering, how can I easily get the ordering of the list, so that, for {0, Sqrt[3], 2 Sqrt[3], Sqrt[3], 3, 2 Sqrt[3]} I get ...
sam wolfe's user avatar
  • 4,903
11 votes
6 answers
1k views

A complicated sorting problem

ClearAll["Global`*"]; list = {{c, c, c}, {b, b, b}, {a, a}, {x, x}, {d}, {e}}; I want to sort the sublists with more than one element in descending ...
eldo's user avatar
  • 81.5k
4 votes
3 answers
664 views

How to sort the poker card?

Define the order of sorting as 2>A>K>Q>J>10>9>8>7>6>5>4>3. How can I reorder each of the three sets of data in the list from smallest to largest according to this ...
csn899's user avatar
  • 4,521
1 vote
0 answers
43 views

Identification of terms

I have the following sum on terms: ...
Ruth Murphy's user avatar
3 votes
5 answers
146 views

Sorting logic and generation of letter sequence

In the context of experimental designs, it is common to generate the various treatment names to build the factorial design table. The table of the 2^2 design reads : For the 2^3, the table reads : ...
Jocelyn Minini's user avatar
5 votes
3 answers
198 views

How can I make the list of largest abscissae from a nested list of coordinates?

Suppose I have a nested list of coordinates as: ...
codebpr's user avatar
  • 2,433
3 votes
2 answers
149 views

What are #1 and #2 in the Sort[{{a, 2, 5}, {c, 1, 4}, {d, 3, 2}}, #1[[3]] < #2[[3]] &]? [closed]

Sort[{{a, 2, 5}, {c, 1, 4}, {d, 3, 2}}, #1[[3]] < #2[[3]] &] In the above code, the list is ordered based on the third element of each sublist. But what ...
metroidman's user avatar
2 votes
2 answers
77 views

Implementing HeapSort in WL

Good day, I am trying to implement the HeapSort Algorithm using WL. My attempt is shown below. ...
LambdaHaskell's user avatar
6 votes
5 answers
904 views

How to sort filenames in actual numerical order?

I have inherited a collection of files that are numbered... something like: file-0, file-1, file-2, ... file-9, file-10, file-11, ... file-19, file-20, ... When I Import them, they come in scrambled ...
bill s's user avatar
  • 69.4k

15 30 50 per page
1
2 3 4 5
30