Permutations of every subset of size K
Problem
Given a array of characters of size N. Devise an algorithm to generate all possible permutations of given size K (K <= N). Solution
Method 1 - Append characters till the length K is reached
We first list the combinations using recursive procedure by selecting or not selecting characters until K length has been formed The for each combination we permute them using another recursive procedure
Time : O(N!
[Read More]