Tag Archives: permutation

Permutation and Combination

Permutation Permutation means arranging all the members of a set into some sequence or order, or if the set is already ordered, rearranging (reordering) its elements, a process called permuting. These differ from combinations, which are selections of some members of a set where order is disregarded. For example, written as tuples, there are six […]

Next even permutation of a number

Given a number N. Find the smallest even number greater than N such that the digits are a permutation of the number N. A trivial solution to start with would be to generate all the permutations of digits of the given number and then sort all the permutations. The first even permutation in the sorted […]