Skip to content

Commit

Permalink
Adds README
Browse files Browse the repository at this point in the history
  • Loading branch information
samagra14 committed May 17, 2018
1 parent 073991b commit 611990a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Combinatorial_lib for java
The aim of this library is to provide an interface
similar to `itertools` in python.

### Example Usages
#### Combinations
To iterate over all combinations of `k` objects from a `List<T> list` just use
`CombinationGenerator.generateCombinations(list,k)`
````java
for (List<T> possibleCombinations :
CombinationGenerator.generateCombinations(list,k)) {
//perform operations on your combinations
}
````
#### Permutations
To iterate over all permutations of `k` objects from a `List<T> list` just use
`CombinationGenerator.generateCombinations(list,k)`
````java
for (List<T> possiblePermutations :
PermutationGenerator.generatePermutations(list,k)) {
//perform operations on your permutations
}
````

0 comments on commit 611990a

Please sign in to comment.