Questions tagged [sorting]
Questions on the sorting/ordering functions of Mathematica (Sort, SortBy, Ordering, etc.).
436
questions
1
vote
3
answers
102
views
How to sort the terms in a polynomial according to their degree?
I have the polynomial
...
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
...
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 ...
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 ...
2
votes
1
answer
75
views
2
votes
1
answer
108
views
Fastest splitter?
Consider some dataset
...
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
...
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
...
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 ...
1
vote
0
answers
43
views
Identification of terms
I have the following sum on terms:
...
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 :
...
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:
...
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 ...
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.
...
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 ...