306 views
0 votes
0 votes
consider a stack A with 4 elements a,b,c,d with a being top of the stack . satck B is empty . an element popped out of stack A printed imidiatly or pushed to stack B. an entry popped out of stck B can only be printed . in tis arrangement how many numbers of possible permutation will be there to print output?

2 Answers

1 votes
1 votes
The answer for generalized N items is the Nth catalan number .

Given by $F(N) = \sum_{0}^{N-1} F(N-1-i)*F(i) = C_{n}^{2n}/(n+1)$

So the answer for N=4 is 14

Related questions

1 votes
1 votes
2 answers
1
Pooja Khatri asked May 16, 2019
632 views
How many 4 letter combinations can be made with the help of letters of the word STATISTICS?
0 votes
0 votes
0 answers
2
Dipanshu Rana asked Mar 21, 2019
498 views
Find the no. of permutations of the letters of the word ‘REMAINS’ such that the vowels always occur in odd places?
0 votes
0 votes
0 answers
4
Ayush Upadhyaya asked Oct 27, 2018
421 views
If $^nP_6=332640$How to quickly and efficiently find out the value of n.I know that fact that product of m consecutive integers is divisible by m!.How can we find the val...