集合运算工具

集合运算 集合运算:求交集,并集,差集。以及求子集和补集。(图片来自百科) 工具类 import java.util.*; class SetUtil { // 并集 static <T> Set<T> union(Set<T> a, Set<T> b) { Set<T> unionSet = new LinkedHashSet<T>(a); unionSet.addAll(b);
相关文章
相关标签/搜索