Hi guys,
I need to find a fast algorithm to generate all possible sentences from a given words list, e.g:
Words : word1 word2 word3
Output :
word1 word2 word3
word1 word3 word2
word2 word1 word3
word2 word3 word1
word3 word1 word2
word3 word2 word1
This implementation needs to be very fast and non-linear
Thanks for your help