10 Topics

Member Avatar for
Member Avatar for xrjf

The present code snippet just does an especific task. This is, given an ordered sequence of natural numbers, starting at zero, generate all the different permutations there can be. When we talk about permutations, the order of the sequence does matter. So, the sequence 0, 1, 2 differs from 2, …

Member Avatar for xrjf
0
2K
Member Avatar for vegaseat

This snippet allows you to find the number of ordered permutations of items taken from a population of known size. It uses the well know algorithm with factorials. For very large populations you may want to use an approximation of factorials.

3
3K
Member Avatar for mitchell5879

Hello, I am having a problem with the output for my sub-string generator program. input: abc desired output: a, b, c, ab, bc, ac, abc current output: abc, abcc, abcb, abcbc, abca, abcac, abcab, abcabc I am sure the error is right in front of me, but I have been …

Member Avatar for zhizu
0
171
Member Avatar for HelloJarvis

Hi all, I have a PHP script that takes a string and lists all its permutations, but ONLY based on its length. So for instance, let's just say we had the word "racecar". Yes, it would list all permutations of the 7-character word "racecar" such as "acrerac", etc. but NOT …

Member Avatar for LastMitch
0
297
Member Avatar for PHkiDz

Hello good day to all... is there anyone can help or suggest me how my code work successfully. Actually the code was working well, but i wanted to change it`s content to GUI form. the program description was the user must input a word/String and shuffle/scramble the word that the …

Member Avatar for JamesCherrill
0
234
Member Avatar for Momerath

As a companion article to my [URL="http://www.daniweb.com/code/snippet349081.html"]Permutation Generation[/URL], I now present Combination generation. This snippet will do a lazy generation of the combinations of a set of objects. Each combination has a grouping size (number of items in each combination). If you need a different grouping size, you'll have to …

Member Avatar for codeholic
2
1K
Member Avatar for Dasharnb777

I have 5 strings, such as: "one", "two", "three", "four", and "five". I need to get all permutations of these words. I've explored all internet resources, but all solutions are so bulky and it's hard for me to understand it and integrate it to my program. So, maybe you know …

Member Avatar for Momerath
0
2K
Member Avatar for Momerath

Generating permutations of a sequence is a problem that is commonly asked. It's fairly easy to do if you know how many items will be used beforehand, but a generic method to do so would be better. The snippet will do a lazy generation of the permutations (the next one …

Member Avatar for ddanbe
3
1K
Member Avatar for king_koder

I tried to generate permutations by using itertools module but its not working. [CODE=python] >>>print(permutations([1,2,3],3)) <itertools.permutations object at 0xa917c5c> [/CODE] Why is it so? and how do I make it work properly?

Member Avatar for slate
0
192
Member Avatar for ~s.o.s~

Hello here i am posting the non recursive or no recursion implementation of outputting [B]Permutations of a string [/B]as compared to the recursive implementations previously posted. Any feedback, constructive criticism or comments are most welcome.

Member Avatar for samir1
0
2K

The End.