Regarding Stacks

How to compute all the permutations of a stack of numbers from 1 to n without using stack STL. I tried using matching paranthesis but got the wrong answer.

Hi @keshari , i replied to you on personal inbox please let me know, if you have some other doubt.