This is more of a mathematical problem; I think nothing is programming.
Suppose I have stack, and I want to find permutationsnumbers 1,2,3,...n. I can pushand pop. for example, if n = 2: push,pop,push,pop1.2 and push,push,pop,pop2.1
if n = 4, I can get 14from permutations 24using stack. Does anyone know any function F(n)that can lead to a permutationsstack count (just one)? e.g. F (1) = 1
F (2) = 2
F (4) = 14
alhid source
share