赞
踩
1-1
In Union/Find algorithm, if Unions are done by size, the depth of any node must be no more than N/2, but not O(logN). F
Time complexity of N Union and M Find operations is now O( N + M log2 N ).
Let T be a tree created by union-by-size with N nodes, then height(T)<=(log2N)+1;
2-6
Let T be a tree created by union-by-size with N nodes, then the height of T can be . A
A.at most log 2(N)+1
B.at least log2(N)+1
C.as large as N
D.anything that is greater than 1
2-5
In a disjoint set problem, given a set of m elements S = { 1, 2, 3, …, m } and n ( 0<n<m ) distinct relations, the set S must have __ equivalence classes. D
A.at leatst m
B.exactly n
C.exactly m−n
D.at least m−n
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。