public class Partition extends Object
| 构造器和说明 |
|---|
Partition(Linkable work)
Construct a Partition without any set
|
Partition(Linkable work,
int n)
Construct a Partition with some sets
|
public Partition(Linkable work)
work - indicating addition work when linking two setspublic Partition(Linkable work, int n)
work - indicating addition work when linking two setsn - number of set containing exactly one element at fristpublic void makeSet()
public int findRoot(int n)
n - the index of the elementpublic void union(int m,
int n)
m - an element contained in the first setn - an element contained in the second setpublic boolean isRoot(int n)
n - the index the elementCopyright © 2019. All rights reserved.