Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > permutations II

Reply
Thread Tools

permutations II

 
 
Eric Sosman
Guest
Posts: n/a
 
      04-28-2009
BartC wrote:
>
> In the real world letter case usually has no significance.


I'm surprised you think this way, bARTc.

--
Eric Sosman
http://www.velocityreviews.com/forums/(E-Mail Removed)lid
 
Reply With Quote
 
 
 
 
Bill Cunningham
Guest
Posts: n/a
 
      04-28-2009

"Carl" <(E-Mail Removed)> wrote in message
news:gt7bh7$scq$(E-Mail Removed)...

[snip]

> I believe you can code it that way. If you are interested, I can post the
> source.


I would much appreciate it. I do what to work with char permutations.
Takes the word "zeus". There's going to have to be a counter somewhere I do
understand that concept. Coding it is different.

Bill


 
Reply With Quote
 
 
 
 
Ben Bacarisse
Guest
Posts: n/a
 
      04-28-2009
"Bill Cunningham" <(E-Mail Removed)> writes:

> "Ben Bacarisse" <(E-Mail Removed)> wrote in message

<one way to count permutations>
>> ... Can you see the pattern? Could you take an array of n ints an
>> make the "next" counter value from it?

>
> I don't think so. I don't know how to code it. I'm thinking
> using for?


You'd need some loop/loops but I think you should probably try a
simpler problem first. Where do you get these problems from? Do you
finish any of them?

--
Ben.
 
Reply With Quote
 
Carl
Guest
Posts: n/a
 
      04-28-2009
Bill Cunningham wrote:
> "Carl" <(E-Mail Removed)> wrote in message
> news:gt7bh7$scq$(E-Mail Removed)...
>
> [snip]
>
>> I believe you can code it that way. If you are interested, I can post the
>> source.

>
> I would much appreciate it. I do what to work with char permutations.
> Takes the word "zeus". There's going to have to be a counter somewhere I do
> understand that concept. Coding it is different.
>
> Bill
>
>


http://antidom.com/permutation_generator.zip

Is this what you were looking for?
 
Reply With Quote
 
nick_keighley_nospam@hotmail.com
Guest
Posts: n/a
 
      04-29-2009
On 27 Apr, 22:45, "Bill Cunningham" <(E-Mail Removed)> wrote:
> <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed)...
>
> define "read the number of characters"
> define "sift them around"
>
> <snip>
>
> * * I think I need a char** definition here. Maybe I could replace CHAR_MAX
> with 40 or something like that. I'll post something soon that I believe
> might get me closer.


you didn't give a definition of the two terms
 
Reply With Quote
 
Bill Cunningham
Guest
Posts: n/a
 
      04-30-2009

"Carl" <(E-Mail Removed)> wrote in message
news:gt7v18$dla$(E-Mail Removed)...

>
> http://antidom.com/permutation_generator.zip
>
> Is this what you were looking for?


I can't seem to get it to work on linux. Is this for windows?

Bill


 
Reply With Quote
 
Carl B. Edwinson
Guest
Posts: n/a
 
      04-30-2009
Richard Heathfield wrote:
> Bill Cunningham said:
>
>> "Carl" <(E-Mail Removed)> wrote in message
>> news:gt7v18$dla$(E-Mail Removed)...
>>
>>> http://antidom.com/permutation_generator.zip
>>>
>>> Is this what you were looking for?

>> I can't seem to get it to work on linux. Is this for windows?

>
> No, it's ISO C - or at least, nearly so.
>
> I made the following adjustments:
>
> 1) added a newline to the end of the file;
> 2) changed two format specifiers from %s to %d for __LINE__
> printing.
>
> I then got a reasonably clean build, which works just fine, although
> the usage instructions are wrong. On the command line, pass the
> length of the desired output as the first command line argument,
> and a series of one or more characters as the second command line
> argument. (The instructions have this the wrong way around.)
>
> For example, if you specify 3 abcd as the command line arguments
> (after the program name), you get this output (which I've piped
> through fmt to reduce vertical space requirements):
>
> aaa baa caa daa aba bba cba dba aca bca cca dca ada bda cda dda
> aab bab cab dab abb bbb cbb dbb acb bcb ccb dcb adb bdb cdb ddb
> aac bac cac dac abc bbc cbc dbc acc bcc ccc dcc adc bdc cdc ddc
> aad bad cad dad abd bbd cbd dbd acd bcd ccd dcd add bdd cdd ddd
>



Sorry about that. I've only had 1 year of C under my belt. This code
was a snippet from a password cracker I was working on. The benefit of
this permutation is that you can start permuting from any point in the
array. So, the idea is to permute the next value, and then let each
thread of the program permute the rest of the elements.

Oh, this was for CUDA, which puts an extremely high price on branching
instuctions. Since each thread will do nearly the exact same thing, the
code is ideal for it. Also, notice that no modulus was used.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Slightly OT] Which algorithm for permutations Hendrik Maryns Java 0 03-03-2006 02:10 PM
Permutations of instances in array Karsten Wutzke Java 5 03-04-2004 04:49 AM
Finding permutations of a list in a map or multimap Daniel Fortin C++ 3 02-18-2004 09:51 AM
Permutations Ed Neukirch C++ 7 12-27-2003 12:44 AM
Permutations with repatitions in c++ Roger C++ 1 09-24-2003 10:52 PM



Advertisments