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

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?

Step by Step Solution

3.24 Rating (170 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a When we perform a union we push onto a stack the ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

1486-C-S-A(452).docx

120 KBs Word File

Students Have Also Explored These Related Algorithms Questions!