public void connect_elements() { quickunion_weighted qu = new quickunion_weighted(10); int[] groups = qu.GetObjects(); quickunion.Union(groups, 2, 6); Assert.IsTrue(qu.Connected(2, 6), "Union has not connected elements"); }
public void are_connected() { quickunion_weighted qu = new quickunion_weighted(10); int[] groups = qu.GetObjects(); groups[5] = 1; groups[3] = 1; Assert.IsTrue(qu.Connected(5, 3), "Elements should be connected"); }