It is not clear to me what you are asking, Bathrinath. For example, you say that you can do this:
3-4-2-6-5-1 --> 6-4-2-3-5-1
Presumably you can also then do this:
6-4-2-3-5-1 --> 6-3-2-4-5-1
followed by this:
6-3-2-4-5-1 --> 4-3-2-6-5-1
In so doing, you would have performed in three swaps something you stated was not allowed, namely that the 3 and 4 in the first part have in effect been interchanged. Can you explain more clearly what it is you really mean?
I am guessing that what you really mean is that you are dividing up the six positions into two groups, one consisting of the first m positions and the other the remaining 6-m positions. Ordering within each group does not matter. What matters is what numbers lie in each group. These are what is known as 'combinations' and their total number would be
6!/m!/(6-m)!,
not 6!. The matlab function 'nchoosek' can be used to generate a list of all such groupings.
The algorithm you describe involving a sequence of swaps sounds like a very difficult method of achieving what you are seeking, whether it is for combinations or something else. The problem is first, making sure you don't duplicate a grouping you have already had, and second, making sure that all possibilities have been realized. There are much more efficient algorithms than that for this purpose.