Due: Tuesday March 18, 2003 at the beginning of class
for i := 1 to n makeset(i) for i := 1 to n-1 union( find(i), find(i+1) ) for i := 1 to n find(i)
(a) Analyze the time complexity of the above sequence of
operations assuming no heuristics are applied (i.e.,
no weighted union, and no path compression).
Assume union(x,y) always makes x a child of y.
(b) Analyze the time complexity of the above sequence of
operations assuming the weighted union heuristic
(but not path compression) is applied.
(c) Analyze the time complexity of the above sequence of
operations assuming the path compression heuristic
(but not weighted union) is applied.
Assume union(x,y) always makes x a child of y.
(d) Analyze the time complexity of the above sequence of
operations assuming both weighted union heuristic
and path compression are applied.
Due by Tuesday April 1, 2003
These problems can be done for extra credit. Points for bonus problems will be tabulated separately, and will be considered separately at the end of the semester.
They should be turned in separately from your regular assignment. They will be accepted upto two weeks past the due date of the assignment.