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
a When we perform a union we push onto a stack the ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
1486-C-S-A(452).docx
120 KBs Word File
