java的permutations / combinatorics库? [英] permutations/combinatorics library for java?

查看:285
本文介绍了java的permutations / combinatorics库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个java库,它将生成一个集合的所有可能的顺序排列。我能找到的唯一一个库是谷歌代码上的combinatoricslib 。我发现很难相信这是唯一能够做到这一点的java库,而且非常坦率地对此感到非常惊讶。

I am looking for a library for java that will generate all possible order permutations of a set. The only library I can find is combinatoricslib on google code. I find it very hard to believe this is the only java library that does this, and am quite frankly very surprised by this.

JDK中有什么东西,或者apache公共数学,或另一个库,提供相同的功能?

Is there anything in the JDK, or apache commons math, or another library, that provides this same functionality?

我很高兴使用combinatoricslib,我只是不相信这是唯一的选择,除了编写算法本身,这当然不是那么困难,但两者都不是.isBlankOrNull(),而apache公共包括那个。

I am happy to use combinatoricslib, I just can't believe that's the only option, other than writing the algorithm myself, which admittedly is not that difficult, but neither is .isBlankOrNull(), and apache commons includes that.

推荐答案

有你检查了番石榴?它似乎提供了集合2

Have you checked Guava? It seems to offer permutations in Collections2


Class Collections2

permutations(集合元素)

返回指定集合的​​所有排列的集合。

Class Collections2
permutations(Collection elements)
Returns a Collection of all the permutations of the specified Collection.

这篇关于java的permutations / combinatorics库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆