[algogeeks] Re: implement next_permutation

2011-08-02 Thread Grapher
It generates all possible permutations. That is not what i want. Just the next permutation which is lexicographically higher. Any ideas or just the algorithm to perform the same On Aug 2, 4:15 pm, DK wrote: > http://marknelson.us/2002/03/01/next-permutation/ > will give you an answer. > (It's th

[algogeeks] implement next_permutation

2011-08-02 Thread Grapher
The question is to find the next lexicographically higher (similarly lower) permutation of the given array of integers or characters. implementation of next_permutation( ) function present in the algorithm header in c++ -- You received this message because you are subscribed to the Google Groups

[algogeeks] Convert number to negative base

2011-07-30 Thread Grapher
This question was asked recently in an interview. Convert a number to base -2 Conversion is pretty straightforward. But how do you code for it ?? Please help. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email

[algogeeks] String vs char array

2011-07-29 Thread Grapher
string str("Hello"); int main() { str[3]=0; cout