In the link you have specified they are talking about using the C++
STL . I would like to know how is that STL implemented
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To
What are the parameters it is taking i and j? What are those? We only
have to permute(s)-where s is the string.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe
Don't forget repeats. The string aaa has only one permutation.
A related interesting question is how to write a permutation
iterator. Here is the interface:
typedef struct {
// your code here
} PERMUTATION_ITERATOR;
/* Initialize the given permutation iterator with the string of n
@ravu
I have mentioned how next permutation works.. Also i have given an
example in another post. Please go thru the link..
On Dec 28, 10:47 pm, Gene gene.ress...@gmail.com wrote:
Don't forget repeats. The string aaa has only one permutation.
A related interesting question is how to write a
Have a look at this algo :- Steinhaus–Johnson–Trotter algorithm .
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
This might help..
http://groups.google.com/group/algogeeks/browse_thread/thread/d3dafdcd53f101a9#
On Dec 28, 11:53 am, SAMMM somnath.nit...@gmail.com wrote:
Have a look at this algo :- Steinhaus–Johnson–Trotter algorithm .
--
You received this message because you are subscribed to the Google
Hi,
Using Backtracking,
void swap(char* x,char* y)
{
char temp;
temp=*x;
*x=*y;
*y=temp;
}
void permute(char* a,int i,int n)
{
int j;
if(i==n)
printf(%s\n,a);
else
{
for(j=i;j=n;j++)
{
swap((a+i),(a+j));
permute(a,i+1,n);
swap((a+i),(a+j));
}
}
}
But this takes O(n*n!) time
--
You received