Name

set_difference

Synopsis

int set_difference(Set *setd, const Set *set1, const Set *set2);

Return Value

0 if computing the difference is successful, or -1 otherwise.

Description

Builds a set that is the difference of set1 and set2. Upon return, setd contains the difference. Because setd points to data in set1, the data in set1 must remain valid until setd is destroyed with set_destroy.

Complexity

O (mn), where m and n are the number of members in set1 and set2, respectively.

Get Mastering Algorithms with C 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.