471,336 Members | 1,267 Online

# 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 1544 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 discussion thread is closed

Replies have been disabled for this discussion.

### Similar topics

 7 posts views Thread by Mike | last post: by 10 posts views Thread by Talin | last post: by 3 posts views Thread by Jack Middleton | last post: by 1 post views Thread by user | last post: by 6 posts views Thread by Rajesh | last post: by 27 posts views Thread by onkar | last post: by 3 posts views Thread by weidongtom | last post: by 6 posts views Thread by badcrusher10 | last post: by 7 posts views Thread by xirowei | last post: by reply views Thread by 249740 | last post: by 1 post views Thread by Yacine Si Tayeb | last post: by reply views Thread by ryjfgjl123 | last post: by reply views Thread by Genny | last post: by reply views Thread by RamLakshmanan | last post: by reply views Thread by Yacine Si Tayeb | last post: by reply views Thread by sheikhsab | last post: by 3 posts views Thread by Curious27 | last post: by 1 post views Thread by DJRhino1175 | last post: by 1 post views Thread by accecssuser | last post: by