Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / August 2005

Tip: Looking for answers? Try searching our database.

Permutation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lucotuslim - 14 Aug 2005 16:03 GMT
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.
Signature

Lucotus

Stephany Young - 14 Aug 2005 16:57 GMT
 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

> Hi,
> Need help to permutate all the posible combination of string for example
[quoted text clipped - 7 lines]
>
> Thanks.
Nick Malik [Microsoft] - 14 Aug 2005 18:16 GMT
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?

Signature

--- 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.
--

>  Dim arr(2,2) As String
>
[quoted text clipped - 27 lines]
>>
>> Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.