Ordered set
An ordered set is a collection of distinct elements maintained according to a defined ordering, comparator, natural ordering, or associated ordering value.
Amazon Web Services in Action, Third Edition: An in-depth guide to AWS
A sorted set is a collection of unique members maintained in order according to an associated score or ordering value.
- How it is used
- Uses a Redis sorted set as an in-memory game leaderboard for frequent score and rank reads.
- How deep it goes
- Explains automatic score-based ordering and fast retrieval, but not sorted-set internals.
- Examples
- Uses a mobile-game leaderboard of player scores and ranks as its concrete example.
- What you can do after
- Apply a Redis sorted set to keep game scores ordered and retrieve leaderboard data from memory.
Java Persistence with Spring Data and Hibernate epub
SortedSet is the Java collection interface for a set whose elements are ordered according to a specified comparator or their natural ordering.
- How it is used
- Deploys SortedSet for unique persistent elements whose iteration order must remain stable.
- How deep it goes
- Explains TreeSet initialization, natural or comparator sorting, in-memory loading behavior, and the database-ordering alternative.
- Examples
- Uses a persistent set of image filenames, natural String ordering, custom comparators, and LinkedHashSet database ordering.
- What you can do after
- Operate/configure a Hibernate SortedSet mapping and select between in-memory sorting and database ordering.
Read how Java Persistence with Spring Data and Hibernate epub explains ordered set →
Clojure: The Essential Reference
sorted-set is a Clojure function that creates a set whose elements are maintained according to a comparator-defined ordering.
- How it is used
- Maintains unique values in comparator order, especially when updates and ordered lookup occur incrementally.
- How deep it goes
- Defines inputs, outputs, exceptions, implementation class, comparator behavior, metadata, and custom tie-breaking examples.
- Examples
- Uses reverse sorting, custom collection comparators, metadata on duplicate values, and an incrementally updated dictionary.
- What you can do after
- Build it from scratch with sorted-set or sorted-set-by, select comparators, preserve ordering during updates, and avoid comparator-induced duplicates.
Read how Clojure: The Essential Reference explains ordered set →
Also covered in
What to know first
- setA set is a collection of distinct elements in which membership, rather than order or duplicate occurrences, defines the collection.
Related concepts
- hash-setalternative to · hash-set is a Clojure function that creates an unsorted set from zero or more values, retaining only one value for each equality class.
- comparison functionuses · A comparison function or strategy compares two values and indicates their relative ordering, and sometimes whether they are equivalent.
- model bindingproduced by · Model binding is the process of locating incoming data, converting it to appropriate types, and assigning it to application objects or handler parameters.
- Redisused by · Redis is an open-source, in-memory data-structure store that provides network-accessible data operations and can serve as a database, cache, or message broker.
- sorted collectionkind of · A sorted collection is a collection whose elements are maintained or presented according to a defined ordering relation.
Questions about ordered set
What is ordered set?
An ordered set is a collection of distinct elements maintained according to a defined ordering, comparator, natural ordering, or associated ordering value.
Which Manning books explain ordered set?
Amazon Web Services in Action, Third Edition: An in-depth guide to AWS, Java Persistence with Spring Data and Hibernate epub and Clojure: The Essential Reference.
What should I know before learning ordered set?
Manning books that teach ordered set usually introduce red-black tree and set first.
What is the difference between ordered set and hash-set?
An ordered set is a collection of distinct elements maintained according to a defined ordering, comparator, natural ordering, or associated ordering value. hash-set is a Clojure function that creates an unsorted set from zero or more values, retaining only one value for each equality class.
What is ordered set a kind of?
Ordered set is a kind of sorted collection. A sorted collection is a collection whose elements are maintained or presented according to a defined ordering relation.
What is ordered set also called?
Ordered set is also called sorted set.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


