473,396 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Permutations of an array

1
Hi everybody,
I need an algorithm that finds all n tuble Permutation of an array which has m element.
for example if my array consists of {a,b,c}
then if i send a Parameter such as 2

the Program should give the following result set

{ab,ac,bc,ba,cb,ca}

both the number of elements in the array and the number according to which we group the elements can change.....

Can anyone help me?
Sep 4 '07 #1
1 1084
Plater
7,872 Expert 4TB
That sounds like homework. We are not to give out answers to homework.

It really doesn't sound hard though.

Are you sure your result set is correct? It seems like with more then 2 places the grammer becomes complex and not all situtations are intuitive

It seems like you have mix between two "normal" result sets
{a,b,c} with 2
would be (I say normally because full inclusion or exclusion are typical requests):
{ab,ac,bc} or {aa,ab,ac,ba,bb,bc,ca,cb,cc}
Sep 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Steve Goldman | last post by:
Hi, I am trying to come up with a way to develop all n-length permutations of a given list of values. The short function below seems to work, but I can't help thinking there's a better way. ...
20
by: John Trunek | last post by:
I have a set of X items, but want permutations of length Y (X > Y). I am aware of the permutation functions in <algorithm>, but I don't believe this will do what I want. Is there a way, either...
1
by: DrNick | last post by:
Hi All I have a problem I'm hoping someone can help me out with. I need to obtain different permutations of a list of objects. However, the list could potentially be enormous (~1000 objects) and I...
7
by: Christian Meesters | last post by:
Hi, I'd like to hack a function which returns all possible permutations as lists (or tuples) of two from a given list. So far, I came up with this solution, but it turned out to be too slow for...
3
by: shihaoran | last post by:
I need help with a classabout arraylist. Please Help. 1. Write a program that produces random permutations of the numbers 1 to 10. (Note: “Permutation” is a mathematical name for an...
0
by: JosAH | last post by:
Greetings, last week I stated that a lot of topics in a lot of forums mention all sorts of sorting problems. Last week's tip gave an answer to quite a bit of those sorting problems. Another...
1
by: JosAH | last post by:
Greetings, last week we talked a bit about generating permutations and I told you that this week will be about combinations. Not true; there's a bit more to tell about permutations and that's...
5
by: Shraddha | last post by:
Suppose we are having 3 variables...a,b,c And we want to print the permutations of these variables...Such as...abc,acb,bca...all 6 of them... But we are not supposed to do it mannually... I...
2
by: Assimalyst | last post by:
Hi I have a Dictionary<string, List<string>>, which i have successfully filled. My problem is I need to create a filter expression using all possible permutations of its contents. i.e. the...
82
by: Bill Cunningham | last post by:
I don't know if I'll need pointers for this or not. I wants numbers 10^16. Like a credit card 16 digits of possible 10 numbers, so I guess that would be 10^16. So I have int num ; These are of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.