473,383 Members | 1,862 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,383 software developers and data experts.

Permutation

Hi,
Need help to permutate all the posible combination of string for example

Dim arr(2) As String
arr(0) = "A"
arr(1) = "B"
arr(2) = "C"

I need the list of posible combination like "ABC" , "ACB", ... etc

Thanks.
--
Lucotus
Aug 14 '05 #1
2 1606
Dim arr(2,2) As String

arr(0,0) = "A"
arr(0,1) = "B"
arr(0,2) = "C"
arr(1,0) = "A"
arr(1,1) = "B"
arr(1,2) = "C"
arr(2,0) = "A"
arr(2,1) = "B"
arr(2,2) = "C"

For _i As Integer = 0 To 2
For _j As Integer = 0 To 2
For _k As Integer = 0 To 2
Console.Writeline(arr(_i,_i) & arr(_i,_j) & arr(_i,_k))
Next
Next
Next

"lucotuslim" <lu********@hotmail.com> wrote in message
news:95**********************************@microsof t.com...
Hi,
Need help to permutate all the posible combination of string for example

Dim arr(2) As String
arr(0) = "A"
arr(1) = "B"
arr(2) = "C"

I need the list of posible combination like "ABC" , "ACB", ... etc

Thanks.
--
Lucotus

Aug 14 '05 #2
Hi Stephany,

On this and similar forums, it is seen as bad form to answer homework
questions. Let's try to avoid doing that, OK?

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Stephany Young" <noone@localhost> wrote in message
news:u5**************@TK2MSFTNGP15.phx.gbl...
Dim arr(2,2) As String

arr(0,0) = "A"
arr(0,1) = "B"
arr(0,2) = "C"
arr(1,0) = "A"
arr(1,1) = "B"
arr(1,2) = "C"
arr(2,0) = "A"
arr(2,1) = "B"
arr(2,2) = "C"

For _i As Integer = 0 To 2
For _j As Integer = 0 To 2
For _k As Integer = 0 To 2
Console.Writeline(arr(_i,_i) & arr(_i,_j) & arr(_i,_k))
Next
Next
Next

"lucotuslim" <lu********@hotmail.com> wrote in message
news:95**********************************@microsof t.com...
Hi,
Need help to permutate all the posible combination of string for example

Dim arr(2) As String
arr(0) = "A"
arr(1) = "B"
arr(2) = "C"

I need the list of posible combination like "ABC" , "ACB", ... etc

Thanks.
--
Lucotus


Aug 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Mike | last post by:
Hello all, I'm looking for a free method to apply a one-way encryption to a 64-bit value in an ASP script. Does anyone have any links to existing code or at least a process that I can follow to...
10
by: Talin | last post by:
I'm sure I am not the first person to do this, but I wanted to share this: a generator which returns all permutations of a list: def permute( lst ): if len( lst ) == 1: yield lst else: head =...
3
by: Jack Middleton | last post by:
Hi! I'm lookin for a faster permutation algorithm for matrices. I know that it can be done with multiplying a matrix with a permutation matrix. It just seems a waste to iterate through all those...
1
by: user | last post by:
Hello I have Array of 50 ints. I want to receive random permutation, so in each int will be different number from 0-49. Is there any class for permutation ? Thanx Michal
6
by: Rajesh | last post by:
Hello Everybody, Can anybody help me in writing a C program to generate and print all possible combinations of n numbers. For eg. for 3 numbers(1,2,3) there turn out 3! combinations. (1,2,3),...
27
by: onkar | last post by:
How to generate different permutations of n char array? ex : for n= 3, and basic string = abc bca cab bac cab ..... ... ..
3
by: weidongtom | last post by:
Hi, I have been working at this problem, and I think I need a permutation algorithm that does the following: Given a list of elements that are either a character or a character follows by a...
6
by: badcrusher10 | last post by:
Hello. I'm having trouble figuring out what to do and how to do.. could someone explain to me what I need to do in order to work? THIS IS WHAT I NEED TO DO: Professor Snoop wants a program...
7
by: xirowei | last post by:
Let's say i create a String array that store 4 Alphabets {"A","B","C","D"} How can i get the result if i need permutation of 4P3 and 4P2? I had refer to many examples from the internet, but...
0
by: 249740 | last post by:
Write a program that reads N phrases and determines if one phrase is a permutation of the other. For example: Phrase 1 is: “One World One Dream” Phrase 2 is: “World One One Dream”. Then the output...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.