2.6. Representing Sets
Most readers will be familiar with the programming techniques described below; they are included here to reinforce the notion of ‘set’ in a programming context, thereby integrating many different data structures into a single concept.
In computer languages that support multiple assignments to variables,21 a set is stored as a dynamic, or modifiable, object. Set representations should support several operations, including adding an element to a set, removing an existing member from a set, testing if a given element is a member of a set, enumerating the members of a set, finding the union, intersection, etc., of two sets, and testing if two sets overlap, are disjoint, etc. There is no universal best way to represent a set; ...
Get Systems Analysis and Synthesis 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.