|
|
|
|
|
by Asooka
3165 days ago
|
|
The article keeps mentioning sorted sets, which is slightly confusing, because I am familiar with sets being defined, both in math and every programming language I know, as unordered. Is set in OCaml an ordered collection usually? |
|
Ordered collection != sorted collection, btw. Sorted collections are actually more like sets than like arrays. A data structure that stores the elements in a sorted fashion is actually able to store an unordered collection with naturally defined insertion / deletion operations. (In OCaml, Set data structure is represented as a balanced binary tree, for instance, and it requires an order relation defined for its elements.)