CS21003 Algorithms ICS29003 Algorithms Laboratory |
Autumn 2012, L-T-P: 3-1-0 L-T-P: 0-0-3 |

## Programming Assignment 1

You are given two postive integersnandk. Your task is to fill an array of sizensuch thatWrite a recursive function to do the following:

- All elements of
Aare integers in the range 1,2,...,k.Ais sorted in the increasing order.- Each of the integers 1,2,
...,kappears at least once in the array.

- Report all possible ways of generating the array
A.- Return the count of possibilities.
## Sample output

n = 4 k = 3 The possibilities are: 1 1 2 3 1 2 2 3 1 2 3 3 Total number of possibilities = 3