Question: nodes? Explain what is the amortized cost per delete or insert operation. 3. We have a set of nodes A, B, C, D, E, F,

nodes? Explain what is the amortized cost per delete or insert operation. 3. We have a set of nodes A, B, C, D, E, F, G , H. At each step an edge {X,Y} between 2 nodes is added or a Query(X,Y) is asked of the form "Are nodes X and Y connected by a path of edges?" We will use the disjoint set data structure with union by weight and path compression to answer these queries. Two nodes are in the same set if they are connected by a path. (Assume that if two sets of the same size are unioned, the root earlier in the alphabet becomes the parent. We start with a graph with isolated nodes. We have the following operations: Add {A,B}, Add {B,C}; Add {D,E}, {G,H}, {G,C}, Query(H,E). Draw a picture of the forest of the disjoint set data structure after the execution of all the operations
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
