🎴 Flashcard Mode

Test 5 - Algorithms | Computer Science(CS)

Card1 / 18
Mastered0
Review0
QuestionClick to flip

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?

AnswerClick to flip back
A
union, intersection
💡 Explanation:

Membership & cardinality functions takes constt. time i.e. 0(1), but union & intersection require emparison of 1 element with all the other elements so these two would be slowest.

Change Mode