The current chapter will focus on data structures related to dictionaries and sets. A proper application of these data structures makes it possible to map keys to values and perform fast lookup, as well as make various operations on sets. To simplify the understanding of dictionaries and sets, this chapter will contain illustrations and code snippets.
In the first parts of this chapter, you will learn both non-generic and generic versions of a dictionary, that is, a collection of pairs, each consisting of a key and a value. Then, a sorted variant of a dictionary will be presented, as well. You will also see some similarities between dictionaries and lists.
The remaining part of the chapter will show you how to use hash sets, together with the variant, which is named a "sorted" set. Is it possible to have a "sorted" set? You will get to...