Find Jobs
Hire Freelancers

c++ permutations A-Z

$30-100 USD

Completed
Posted almost 16 years ago

$30-100 USD

Paid on delivery
We need a simple c++ permutations A-Z Algorithm written a certain way. 1. No Recursive functions 2. Must accept N-Length and N-Start for example if I specify in the parameters to start at 4 , and end at 8. 3. Must accept a string for the permutations, if I specify abc123 than it must generate every possible pattern for that string ## Deliverables Here is a example Algorithm , please note you can not use this code or design your algorithm like this since it does not accept a variable length permutation int main(int argc, char *argv[]) { int i,j,k; char list[]="ABCDEFGHIJKLMNOPQR <wbr />STUVWXYZ01<wbr />23456789";<wbr /> char string_result[4]; string_result[3]=0; /* NUL terminate the string */ for (i=0; i<36; i++) { string_result[0]=list[i]; /* Set x__ */ for (j=0; j<36; j++) { string_result[1]=list[j]; /* Set _y_ */ for (k=0; k<36; k++) { string_result[2]=list[k]; /* Set __z */ printf("%s\n",string_resul<wbr />t); /* Print xyz */ } } } return 0; } The thing to realize is that it has a string that it generates permutations from which is what I need. The requires for Algorithm design or as follows. 1. No Recursive design 2. No STL design 3. Must accept a variable start position and a variable end position 4. If starting from 4th position you can specify which permutation you want to start at, so if I specify the 5th permutation with a permutation string of 01 it would start at 0101 5. Must have one variable it stores results in like below void output_chars(unsigned int start, unsigned int end,char * ranges) { #define CYCLE_RANGE(v1) for(unsigned int j1=0;j1<strlen(ranges);j1++) \ { \ output[v1] = ranges[j1]; \ std::cout << output << std::endl; \ } char output[32]; ZeroMemory(output,32); if(start >=end) return; for(unsigned int i2 = 0;i2<end;i2++) //reset the string output[i2] = ranges[0]; unsigned int string_length = 0; for(unsigned int i = start;i<end;i++) { output[i+1]=0; //allocate new memory string_length = strlen(output); unsigned int string_pos = i; while(string_pos) { //how many position to the right of me unsigned int right_pos = i - string_pos; for(unsigned int r1 = i;r1>string_pos;r1--) { for(unsigned int i2 = 0;i2<strlen(ranges);i2++) { output[string_pos-1] = ranges[i2]; std::cout << output << std::endl; } CYCLE_RANGE(r1) } //CYCLE_RANGE(string_pos) string_pos--; } for(unsigned int i2 = 0;i2<end;i2++) //reset the string output[i2] = ranges[0]; } return; } Notice how it only stores data in the output variable, this is very important and this is how the algorithm should be designed If you have any questions please let me know and I am willing to pay what ever it takes.
Project ID: 3088029

About the project

20 proposals
Remote project
Active 16 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$7 USD in 5 days
5.0 (32 reviews)
5.9
5.9
20 freelancers are bidding on average $37 USD for this job
User Avatar
See private message.
$21.25 USD in 5 days
5.0 (183 reviews)
6.5
6.5
User Avatar
See private message.
$42.50 USD in 5 days
4.8 (96 reviews)
6.6
6.6
User Avatar
See private message.
$17 USD in 5 days
5.0 (77 reviews)
6.0
6.0
User Avatar
See private message.
$41.65 USD in 5 days
5.0 (50 reviews)
5.1
5.1
User Avatar
See private message.
$42.50 USD in 5 days
5.0 (37 reviews)
4.4
4.4
User Avatar
See private message.
$42.50 USD in 5 days
5.0 (76 reviews)
4.2
4.2
User Avatar
See private message.
$59.50 USD in 5 days
5.0 (4 reviews)
3.1
3.1
User Avatar
See private message.
$32.30 USD in 5 days
5.0 (5 reviews)
2.8
2.8
User Avatar
See private message.
$42.50 USD in 5 days
5.0 (8 reviews)
2.8
2.8
User Avatar
See private message.
$22.95 USD in 5 days
5.0 (4 reviews)
1.9
1.9
User Avatar
See private message.
$59.50 USD in 5 days
4.0 (6 reviews)
2.3
2.3
User Avatar
See private message.
$15.30 USD in 5 days
5.0 (1 review)
0.4
0.4
User Avatar
See private message.
$41.65 USD in 5 days
5.0 (3 reviews)
0.5
0.5
User Avatar
See private message.
$63.75 USD in 5 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$21.25 USD in 5 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$80.75 USD in 5 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$21.25 USD in 5 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$25.50 USD in 5 days
5.0 (1 review)
0.0
0.0
User Avatar
See private message.
$42.50 USD in 5 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Owings Mills, United States
4.7
5
Member since Apr 26, 2008

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.