It does not take much time to define a set and show what operations they can be used for. What does take time is developing an understanding or intuition about what sort of problems you can solve with sets.
Many problems related to organizing and locating data can be solved beautifully by utilizing sets and set operations, but that is not always apparent. In this chapter, I will go through what sets are as well as what you can do with them, and then I’ll walk you through various realistic examples showing the power of storing data in sets.
- Photo albums
- Email clients
- Bug-tracking systems
- Online shopping
- Software-development projects
- Specialist software, like modeling software for geologists
For a long time the most popular way of organizing data was via tree structures. To find an item you would drill down into subcategories until you found what you were looking for. The problem with this approach is that many items can potentially exist underneath multiple subcategories instead of just one.