Sort using a custom comparator: Difference between revisions

Content added Content deleted
(Added Fōrmulæ solution)
Line 2,479: Line 2,479:




=={{header|Mathematica}}==
=={{header|Mathematica}}/{{header|Wolfram Language}}==
We define a new function to give true or false if two elements are in order.
We define a new function to give true or false if two elements are in order.
After that we can simply use the built-in Sort with an ordering function:
After that we can simply use the built-in Sort with an ordering function: