The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998

18.04.2013 Views

Graph Data Structures Mon Jun 2 23:33:50 EDT 1997 file:///E|/BOOK/BOOK3/NODE132.HTM (5 of 5) [19/1/2003 1:30:08]

Set Data Structures Next: Kd-Trees Up: Data Structures Previous: Graph Data Structures Set Data Structures Input description: A universe of items and a collection of subsets , where . Problem description: Represent each subset so as to efficiently (1) test whether , (2) find the union or intersection of and , and (3) insert or delete members of S. Discussion: In mathematical terms, a set is an unordered collection of objects drawn from a fixed universal set. However, it is usually useful for implementation to represent each set in a single canonical order, typically sorted, so as to speed up or simplify various operations. Sorted order turns the problem of finding the union or intersection of two subsets into a linear-time operation - just sweep from left to right and see what you are missing. It also makes possible element searching in sublinear time. Finally, printing the elements of a set in a canonical order paradoxically reminds us that order really doesn't matter. We distinguish sets from two other kinds of objects: strings and dictionaries. If there is no fixed-size universal set, a collection of objects is best thought of as a dictionary, as discussed in Section . If the order does matter in a subset, i.e. if is not the same as , then your structure is more file:///E|/BOOK/BOOK3/NODE133.HTM (1 of 4) [19/1/2003 1:30:10]

Graph Data Structures<br />

Mon Jun 2 23:33:50 EDT 1997<br />

file:///E|/BOOK/BOOK3/NODE132.HTM (5 of 5) [19/1/2003 1:30:08]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!