Skip to content

Commit 7b30dc2

Browse files
committed
combinations readme
combinations readme
1 parent 4661432 commit 7b30dc2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

java-combinations/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Non-Recursive Algorithm for Finding Combination
2+
===============================================
3+
4+
Here is a generic non-recursive algorithm for finding all possible combination for an array of objects.
5+
6+
For example, if we have an Array of elements=`{"A","B","C","D","E"}` and we want to find the combination of these elements taken 3 at a time.
7+
Using math we can find the number of possible combination using a known [formula](https://en.wikipedia.org/wiki/Combination).
8+
9+
However, to find those combinations we need an algorithm to do so.
10+
Below image explains the steps taken by the algorithm to find the results.
11+
12+
![combinations](http://hmkcode.github.io/images/java/combinations.png)

0 commit comments

Comments
 (0)