| ▲ | LandR 7 days ago | |||||||
Whats the difference between ordered and sorted ?  | ||||||||
| ▲ | Galanwe 7 days ago | parent | next [-] | |||||||
I was confused as well. According to the internet, "ordered" is a material property of a container, it does not depend on the actual values inserted, but rather the insertion sequencing. (e.g. a queue or a stack is ordered, a set is unordered). "sorted" refers to the actual values in the container. So a list is ordered, but can be sorted or not. A set is unordered but sorted. I guess a priority queue is ordered and sorted.  | ||||||||
  | ||||||||
| ▲ | 4b11b4 7 days ago | parent | prev [-] | |||||||
order is a general concept which builds on top of the concept of equality. If they are not equal, then what are they? We can manually define an order for a type to determine which is lesser or greater. once you have this rule (the order), then you can sort effectively you could think of them the same, or that sorting is an application of using the order rules for a given type  | ||||||||