we can generate permutations using stack. For example, if n=1,2,3 and Push() is denoted by "P", and Pop() by "X", then we can generate permutations as : PPPXXX = 321 PPXXPX = 213 PXPXPX = 123 PXPPXX = 132 PPXPXX = 231
(note : at any point, #P's>=#X's and finally, #P's=#X's) ques :- Given n elements, find the number of permutations which are possible and which are not possible?? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/8ZitrJFT4zUJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.