File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ ## Combinatorial_lib for java
2+ The aim of this library is to provide an interface
3+ similar to ` itertools ` in python.
4+
5+ ### Example Usages
6+ #### Combinations
7+ To iterate over all combinations of ` k ` objects from a ` List<T> list ` just use
8+ ` CombinationGenerator.generateCombinations(list,k) `
9+ ```` java
10+ for (List<T > possibleCombinations :
11+ CombinationGenerator . generateCombinations(list,k)) {
12+ // perform operations on your combinations
13+ }
14+ ````
15+ #### Permutations
16+ To iterate over all permutations of ` k ` objects from a ` List<T> list ` just use
17+ ` CombinationGenerator.generateCombinations(list,k) `
18+ ```` java
19+ for (List<T > possiblePermutations :
20+ PermutationGenerator . generatePermutations(list,k)) {
21+ // perform operations on your permutations
22+ }
23+ ````
You can’t perform that action at this time.
0 commit comments