3 votes 3 votes Number of possible permutations that can be obtained using stack if the input sequence is 1, 2, 3, 4, 5 (in the order) is Algorithms algorithms stack + – h4kr asked Jan 31, 2023 • retagged Jan 31, 2023 by makhdoom ghaya h4kr 632 views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply DebRC commented Jan 31, 2023 reply Follow Share This is Catalan Number. https://math.stackexchange.com/questions/1431923/how-many-sequences-possible-in-stack-if-the-input1-2-3-n-is-in-order 2 votes 2 votes h4kr commented Jan 31, 2023 reply Follow Share Im a bit confused still, can you write a solution for this? 2 votes 2 votes DebRC commented Jan 31, 2023 reply Follow Share @h4kr There are $C_5 = 42$ possible permutations for the sequence $(1,2,3,4,5)$ using stack. 1 votes 1 votes h4kr commented Jan 31, 2023 reply Follow Share thanks, but in the solutions of the question where is solved it from had answer: 2048 [cant say their answer is correct, i often found wrong solutions from their Q&A] 2 votes 2 votes Please log in or register to add a comment.
0 votes 0 votes For stack and calculating the valid Permutation when the order of the insertion of element is defined we should use the CATALAN NO $\frac{_{n}^{2n}\textrm{C}}{n+1}$ ie $\frac{_{5}^{10}\textrm{C}}{6}$ = 42 soumya24 answered 1 day ago soumya24 comment Share Follow See all 0 reply Please log in or register to add a comment.