Sets and Maps as Abstractions
Know
A set stores membership without duplicates; a map stores key-to-value associations. Both are specifications, implementable by hashing or by a tree.
Apply
Choose a set when only membership matters and a map when each key carries data.
Watch out
Assuming iteration order. A hash-based structure gives no ordering guarantee.
Study move
Pick a problem for each and say why the other would be the wrong fit.
