Example – swimming pools

This example presents the system for a SPA center with four swimming pools, namely recreation, competition, thermal, and for kids. Each visitor receives a special wrist band that allows one to enter all the pools. However, it is necessary to scan the wrist band while entering any pool and your program can use such data for creating various statistics.

In this example, the hash set is chosen as a data structure for storing unique numbers of wrist bands that have been scanned in the entrance to each swimming pool. Four sets will be used, one per each pool, as shown in the following diagram. Moreover, they will be grouped in the dictionary to simplify and shorten the code, as well as make future modifications easier: ...

Get C# Data Structures and Algorithms now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.