Top "Permutation" questions

A permutation is an arrangement of objects into a particular order.

permutations/combinatorics library for java?

I am looking for a library for java that will generate all possible order permutations of a set. The only …

java permutation combinatorics
How many different possible ways can persons be seated in a round table?

I am developing an algorithm and am looking at a possibility of the maximum number of iterations before arriving at …

algorithm math combinations permutation discrete-mathematics
Generating all 5 card poker hands

This problem sounds simple at first glance, but turns out to be a lot more complicated than it seems. It's …

python algorithm permutation combinatorics poker
Calculate all permutations of a string in Swift

For the string "ABC" the code snippet below calculates 5 of the 6 total permutations. My strategy was to insert each character …

ios swift permutation
How can I generate a list of all possible permutations of several letters?

So I am making a word generator that takes several inputted letters, puts them in all possible positions, and matches …

python permutation alphabetical
How many ways can you insert a series of values into a BST to form a specific tree?

This earlier question asked how many ways there were to insert the values 1 - 7 into a binary search tree that …

algorithm math data-structures permutation binary-search-tree
Is java.util.Random really that random? How can I generate 52! (factorial) possible sequences?

I've been using Random (java.util.Random) to shuffle a deck of 52 cards. There are 52! (8.0658175e+67) possibilities. Yet, I've found …

java permutation random-seed random
Permute rows and columns of a matrix

Assuming that I have the following matrix/array: array([[0, 0, 1, 1, 1], [0, 0, 1, 0, 1], [1, 1, 0, 1, 1], [1, 0, 1, 0, 0], [1, 1, 1, 0, 0]]) and I want to apply the following permutation: 1 -> 5 2 -&…

python-2.7 numpy matrix permutation adjacency-matrix
Given a BST and its root, print all sequences of nodes which give rise to the same bst

Given a BST, find all sequences of nodes starting from root that will essentially give the same binary search tree. …

permutation binary-search-tree sequences
More efficient way to get integer permutations?

I can get integer permutations like this: myInt = 123456789 l = itertools.permutations(str(myInt)) [int(''.join(x)) for x in …

python integer permutation itertools