Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have come across this permutation generator code. But doesn' understand it Can anybody explain how this works? where x will be the string input and y will be initially "" Sub GetPermutation(x As String, y As String) ' The source of this algorithm is unknown Dim i As Integer, j As Integer j = Len(y) If j < 2 Then Cells(CurrentRow, 1) = x & y CurrentRow = CurrentRow + 1 Else For i = 1 To j Call GetPermutation(x + Mid(y, i, 1), Left(y, i - 1) Right(y, j - i)) Next End If End Su -- chandran ----------------------------------------------------------------------- chandrans's Profile: http://www.excelforum.com/member.php...fo&userid=1436 View this thread: http://www.excelforum.com/showthread.php?threadid=27734 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
permutation | Excel Worksheet Functions | |||
Permutation Builder | Excel Discussion (Misc queries) | |||
Permutation in excel | Excel Worksheet Functions | |||
Permutation in excel | Excel Worksheet Functions | |||
Permutation in excel | Excel Worksheet Functions |