Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.excel.programming > #110111
| From | Bruno Campanini <brunocam@libero.it> |
|---|---|
| Newsgroups | microsoft.public.excel.programming |
| Subject | Recursive To non-Recursive Procedure |
| Date | 2017-07-13 15:14 +0200 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <ok7rnn$4aj$1@gioia.aioe.org> (permalink) |
Can anybody convert this recursive procedure to a non-recursive one?
========================================
Sub Permutation(Str1 As String, _
Optional Str2 As String = vbNullString, _
Optional ByRef Xrow As Long = 1)
Dim i As Integer, xLen As Integer, a As String, b As String
xLen = Len(Str1)
If xLen < 2 Then
Range("A" & Xrow) = Str2 & Str1
Xrow = Xrow + 1
Else
For i = 1 To xLen
a = Left(Str1, i - 1) & Right(Str1, xLen - i)
b = Str2 & Mid(Str1, i, 1)
Call Permutation(a, b, Xrow)
Next
End If
End Sub
========================================
The procedure is called, in the simplest way, with:
Call Permutation("string-to-permute").
Bruno
Back to microsoft.public.excel.programming | Previous | Next — Next in thread | Find similar | Unroll thread
Recursive To non-Recursive Procedure Bruno Campanini <brunocam@libero.it> - 2017-07-13 15:14 +0200
Re: Recursive To non-Recursive Procedure "Auric__" <not.my.real@email.address> - 2017-07-13 19:52 +0000
Re: Recursive To non-Recursive Procedure Bruno Campanini <brunocam@libero.it> - 2017-07-14 00:32 +0200
Re: Recursive To non-Recursive Procedure "Auric__" <not.my.real@email.address> - 2017-07-14 19:33 +0000
Re: Recursive To non-Recursive Procedure Bruno Campanini <brunocam@libero.it> - 2017-07-14 22:36 +0200
Re: Recursive To non-Recursive Procedure "Peter T" <askformy@gmail.com> - 2017-07-16 17:58 +0100
Re: Recursive To non-Recursive Procedure Bruno Campanini <brunocam@libero.it> - 2017-07-16 19:51 +0200
Re: Recursive To non-Recursive Procedure "Peter T" <askformy@gmail.com> - 2017-07-16 19:46 +0100
Re: Recursive To non-Recursive Procedure Bruno Campanini <brunocam@libero.it> - 2017-07-17 10:52 +0200
Re: Recursive To non-Recursive Procedure "Peter T" <askformy@gmail.com> - 2017-07-17 12:45 +0100
Re: Recursive To non-Recursive Procedure Bruno Campanini <brunocam@libero.it> - 2017-07-17 20:17 +0200
Re: Recursive To non-Recursive Procedure Living the Dream <noodnutt@gmail.com> - 2017-08-08 05:23 -0700
Re: Recursive To non-Recursive Procedure "Peter T" <askformy@gmail.com> - 2017-08-11 17:43 +0100
Re: Recursive To non-Recursive Procedure Bruno Campanini <brunocam@libero.it> - 2017-08-13 02:19 +0200
Re: Recursive To non-Recursive Procedure "Peter T" <askformy@gmail.com> - 2017-08-13 17:26 +0100
Re: Recursive To non-Recursive Procedure Bruno Campanini <brunocam@libero.it> - 2017-08-14 20:24 +0200
Re: Recursive To non-Recursive Procedure GS <gs@v.invalid> - 2017-08-14 23:14 -0400
Re: Recursive To non-Recursive Procedure "Peter T" <askformy@gmail.com> - 2017-08-15 08:19 +0100
Re: Recursive To non-Recursive Procedure GS <gs@v.invalid> - 2017-08-15 03:28 -0400
Re: Recursive To non-Recursive Procedure "Peter T" <askformy@gmail.com> - 2017-08-15 08:39 +0100
Re: Recursive To non-Recursive Procedure Bruno Campanini <brunocam@libero.it> - 2017-08-15 12:49 +0200
Re: Recursive To non-Recursive Procedure "Peter T" <askformy@gmail.com> - 2017-08-15 08:35 +0100
Re: Recursive To non-Recursive Procedure Bruno Campanini <brunocam@libero.it> - 2017-08-15 11:17 +0200
Re: Recursive To non-Recursive Procedure "Peter T" <askformy@gmail.com> - 2017-08-15 13:21 +0100
Re: Recursive To non-Recursive Procedure Bruno Campanini <brunocam@libero.it> - 2017-08-15 18:19 +0200
Re: Recursive To non-Recursive Procedure Bruno Campanini <brunocam@libero.it> - 2017-08-13 03:16 +0200
Re: Recursive To non-Recursive Procedure Living the Dream <noodnutt@gmail.com> - 2017-08-29 06:08 -0700
csiph-web