-
Suppose each set is represented as a linked list with elements in arbitrary order. Which of the operations among union, intersection, membership, cardinality will be the slowest ?
-
- Union only
- Intersection, membership
- Membership, cardinality
- Union, intersection
- Union only
Correct Option: D
Membership & cardinality functions takes constt. time i.e. O(1), but union & intersection require emparison of 1 element with all the other elements so these two would be slowest.
Hence (d) is correct option.