Monday, July 6, 2009

Generate all the permutations of a given string s.

An interview question: Given a string s, generate all the permutations in optimal space and time.

1 comment:

  1. I like this question, since it shows a basic use of recursion. c++ code is here http://www.di.unipi.it/~gulli/coding/permutation.tgz

    ReplyDelete