Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
尝试一下。
public static <T> Set<Function<T, T>> bijectionsOf(Set<T> set) { ArrayList<T> domain = new ArrayList<>(set); return permutations(domain, new ArrayList<>(), set.size(), 0) .stream() .map(list -> (Function<T, T>) t -> list.get(domain.indexOf(t))) .collect(Collectors.toSet()); }
输出:
1 --> 1; 2 --> 3; 3 --> 2; 1 --> 3; 2 --> 2; 3 --> 1; 1 --> 2; 2 --> 1; 3 --> 3; 1 --> 3; 2 --> 1; 3 --> 2; 1 --> 1; 2 --> 2; 3 --> 3; 1 --> 2; 2 --> 3; 3 --> 1;
Try this.
output:
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(1)
尝试一下。
输出:
Try this.
output: