Suppose we want to add an extra operation, deunion, which undoes the last union operation that has

Question:

Suppose we want to add an extra operation, deunion, which undoes the last union operation that has not been already undone.

a. Show that if we do union-by-height and finds without path compression, then deunion is easy and a sequence of M union, find, and deunion operations takes O(MlogN) time.

b. Why does path compression make deunion hard?

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

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: