/
Forside
/
Teknologi
/
Udvikling
/
VB/Basic
/
Nyhedsindlæg
Login
Brugernavn
*
Kodeord
*
Husk mig
Brugerservice
Kom godt i gang
Bliv medlem
Seneste indlæg
Stil et spørgsmål
Skriv et tip
Pointsystemet
Kontakt Kandu.dk
Emnevisning
Kategorier
Alfabetisk
Karriere
Interesser
Teknologi
Reklame
Top 10 brugere
VB/Basic
#
Navn
Point
1
berpox
2425
2
pete
1435
3
CADmageren
1251
4
gibson
1230
5
Phylock
887
6
AntonV
790
7
strarup
750
8
Benjamin...
700
9
tom.kise
610
10
EXTERMINA..
600
permutation algorithm
Fra :
hhs
Dato :
20-12-01 16:47
I guess there is no function(library) about permutation algorithm in visual
basic
Please let me know the permutation algorithm
I want to get next permutation sequence from Given sequence
12345 ->12354 ->12435->..
Tomas Christiansen (
22-12-2001
)
Kommentar
Fra :
Tomas Christiansen
Dato :
22-12-01 00:15
hhs wrote:
> I guess there is no function(library) about permutation algorithm in
visual
> basic
Not as far as I know.
> Please let me know the permutation algorithm
The algorihm? I can give som code - its not that complicated!
It requires at ListBox names List1 on the form to output the
permutations:
Sub Permute(ByVal Symbols As String, _
Optional ByVal Permutation As String = "")
Dim Position As Long
If Len(Symbols) > 0 Then
For Position = 1 To Len(Symbols)
Permute Left(Symbols, Position - 1) & _
Mid(Symbols, Position + 1), _
Permutation & Mid(Symbols, Position, 1)
Next Position
Else
List1.AddItem Permutation
End If
End Sub
You call it by: Permute "12345"
-------
Tomas
Søg
Alle emner
Teknologi
Udvikling
VB/Basic
Indstillinger
Spørgsmål
Tips
Usenet
Reklame
Statistik
Spørgsmål :
177822
Tips :
31980
Nyheder :
719565
Indlæg :
6410987
Brugere :
218912
Månedens bedste
Årets bedste
Sidste års bedste
Copyright © 2000-2026 kandu.dk. Alle rettigheder forbeholdes.