Menu

[Solved]Question 1 Union Lost Suppose Re Given Tree T Sequence Queries Form Described 1 Remove Edg Q37117791

Question 1 - Union-Lost Suppose youre given a tree T and a sequence of queries, each of which are of the form described belo

Question 1 – Union-Lost Suppose you’re given a tree T and a sequence of queries, each of which are of the form described below (1) Remove edge e from the graph. It is guaranteed that e exists. (2) Given nodes u, in the tree, determine if they are in the same component. The above queries are interspersed among each other. That is, you may be asked to remove some edges, determine if some pairs of nodes are in the same component, then remove some more edges, and so on (a) You are given the entire sequence of queries ahead of time. Design an approach for per- forming queries of type 1 in amortized O(logn) time, and queries of type 2 in amortized constant time. Justify correctness and running time. Show transcribed image text Question 1 – Union-Lost Suppose you’re given a tree T and a sequence of queries, each of which are of the form described below (1) Remove edge e from the graph. It is guaranteed that e exists. (2) Given nodes u, in the tree, determine if they are in the same component. The above queries are interspersed among each other. That is, you may be asked to remove some edges, determine if some pairs of nodes are in the same component, then remove some more edges, and so on (a) You are given the entire sequence of queries ahead of time. Design an approach for per- forming queries of type 1 in amortized O(logn) time, and queries of type 2 in amortized constant time. Justify correctness and running time.

Expert Answer


Answer to Question 1 – Union-Lost Suppose you’re given a tree T and a sequence of queries, each of which are of the form described… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *