已知不相交集合用数组表示为{4, 6, 5, 2,-3,-4, 3}。若集合元素从1到7编号,则调用Union(Find(7),Find(1))(按规模求并并且带路径压缩后的结果数组为 。
A. {4,6,5,2,6,-7,3}
B. {4,6,5,2,-7,5,3}
C. {6,6,5,6,-7,5,5}
D. {6,6,5,6,6,-7,5}
LetTbe a tree ofNnodes created by union-by-size without path compression, then the minimum depth ofTmay be
A. 1
B. logN
C. N−1
D. N/2
In a disjoint set problem, given a set ofmelementsS= { 1, 2, 3, ...,m} andn(0
A. at leatstm
B. exactlyn
C. exactlym−n
D. at leastm−n