This is an algorithm to print combinations of elements in an array following the lexicographic order.
For example if the given array is
{ 'a', 'b', 'c', 'd'}
then the answer should be
ab, ac, ad, bc, bd, abc, abd, acd, bcd, abcd.
Given below is the implementation:
No comments:
Post a Comment