The dynamic-set operation UNION takes two disjoint sets S 1 and S 2 as input, and it

Question:

The dynamic-set operation UNION takes two disjoint sets S1 and S2 as input, and it returns a set S = S⋃ S2 consisting of all the elements of S1 and S2. The sets S1 and S2 are usually destroyed by the operation. Show how to support UNION in O(1) time using a suitable list data structure.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question

Introduction to Algorithms

ISBN: 978-0262033848

3rd edition

Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest

Question Posted: