So I have a table with some numbers. Example: {5, 9, 8, 3, 5}. Now I want to sort them. But I don’t want to sort them in ascending or descending order. I want to sort them in a particular order. Example like: 5 < 8 < 9 < 3. Any idea how to do this?
First I thought of manually checking in order and inserting it into a new table. But that would be very inefficient for a table with a large amount of numbers.
Quite hard to sort if we don’t know this particular order or system you are using.
But I believe what you can do is assign these values to another “weight” value which represents the way you want them sorted in ascending order sort of like sorting a dictionary.