The survey of permutations of finite sets is an important subject in the fields of combinatorics and group theory. In elementary combinatorics, the K-permutations, or partial permutations, are the ordered agreements of K distinct components choose from a set. Stedman widens the consideration of permutations; he goes on to consider the number of permutations of the letters of the alphabet and of horses from a stable of 20.A first case in which apparently unrelated mathematical questions were study with the help of permutations happened around 1770, when Joseph Louis Lagrange, in the survey of polynomial equations, detected that property of the permutations of the beginnings of an equation are associated to the possibility to solve it. Fabian Stedman in 1677 described factorials when explaining the number of permutations of Bell in change ringing. The rule to determine the number of permutations of n objects was known in Indian culture around 1150.

COMING SOON!

```
/*
Petar 'PetarV' Velickovic
Algorithm: Permutations
*/
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <vector>
#include <list>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <complex>
using namespace std;
typedef long long lld;
int n;
int niz[100];
bool inPerm[100];
int currPerm[100];
//Algoritam koji generise sve permutacije datog niza
//Slozenost: O(n!)
void generatePermutations(int pos)
{
if (pos == n)
{
for (int i=0;i<n;i++) printf("%d ",currPerm[i]);
printf("\n");
}
for (int i=0;i<n;i++)
{
if (!inPerm[i])
{
currPerm[pos] = niz[i];
inPerm[i] = true;
generatePermutations(pos+1);
inPerm[i] = false;
}
}
}
int main()
{
n = 3;
niz[0] = 1;
niz[1] = 2;
niz[2] = 3;
generatePermutations(0);
return 0;
}
```