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

And Have you written any code for this ? or even a basic idea of an algorithm ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.