Start New Discussion within our Software Development Community

plz solve this problem


Consider the ADT set that represents a collection of integers. The ADT should support standard set operations:

S = init();
/* Initialize S to the empty set */

isEmpty(S);
/* Return true if and only if S is the empty set */

isSingleton(S);
/* Return true if and only if S contains only one element */

isMember(S,a);
/* Return true if and only if a is a member of the set S */

S = addElement(S,a);
/* Add the element a to the set S. If a is already in S,
there will be no change, else a new element is to be inserted. */

S = delElement(S,a);
/* Remove the element a from the set S. No change if a is not
a member of S. */

S = union(U,V);
/* Assign to S the union of the sets U and V */

S = intersection(U,V);
/* Assign to S the intersection of the sets U and V */

S = difference(U,V);
/* Assign to S the set difference U - V */

S = symmDiff(U,V);
/* Assign to S the symmetric difference (U - V) union (V - U) */

printElements(S);
/* Print the elements of the set S */

Implement the set ADT using dynamic arrays. You will need to use realloc to change the size of an array that was dynamically allocated earlier.

plz solve this problem

A - no one is likely to solve your problem for you. You must attempt the solution, show your work, and we'll help you get to the solution you need.

B - don't ask a question by replying to an unrelated thread - that's hijacking and not appreciated

B+ - really don't do this with a thread that's over 2 years old!

Please read the sticky posts at the top of this forum to learn the rules that will make your visit here more pleasant and productive.

This article has been dead for over six months. Start a new discussion instead.