Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Astack Ahas 4 entries as following sequence a... Start Learning for Free
stack A has 4 entries as following sequence a,b,c,d and stack B is empty. An entry popped out of stack A can be printed or pushed to stack B. An entry popped out of stack B can only be printed.


Then the number of possible permutations that the entries can be printed will be ?


  • a)
    24

  • b)
    12

  • c)
    21

  • d)
    14

Correct answer is option 'D'. Can you explain this answer?
Verified Answer
Astack Ahas 4 entries as following sequence a,b,c,d andstack Bis empty...
permutations which start with D:

to print D first , all a,b,c must be pushed on to stack before popping D and the only arrangement possible = D C B A

permutations start with C:

you need to push a and b from stack A to stack B , now print C

content of stack B= b a (from top to bottom)

content of stack A = d

permutations possible = 3!/2! = 3 = they are c d b a, c b d a, c b a d --> 3 permutations here

permutations starting with b :

to print b first, a will be pushed onto stack B

content of stack B= a

content of stack A= c d

you can bring these out in (3! -1) as (d a c) is not possible--> 5 possible

permutations starting with a:

fix ab

a b _ _

in this a b c d or a b dc

fix ac

a c _ _

a c b d or a c d b

fix ad

a d _ _

a d c b

total 5

total = 1+3+5+5= 14
View all questions of this test
Most Upvoted Answer
Astack Ahas 4 entries as following sequence a,b,c,d andstack Bis empty...
Given, stack A has 4 entries. We need to find the number of possible permutations.

Explanation:

To find the number of possible permutations, we can use the formula:

n! / (n-r)!

where n is the total number of items and r is the number of items to be selected.

In this case, n = 4 (since there are 4 entries in stack A) and r = 4 (since we need to select all 4 entries).

Substituting the values in the formula, we get:

4! / (4-4)! = 4! / 0! = 4 x 3 x 2 x 1 / 1 = 24

Therefore, there are 24 possible permutations when stack A has 4 entries.

However, the correct answer given is option 'D', which is 14. This means that there is some additional information or constraint given in the problem that limits the number of possible permutations.

One possible constraint could be that the entries in stack A are distinct and cannot be repeated. In this case, the formula to be used is:

nPr = n! / (n-r)!

where n is the total number of items and r is the number of items to be selected without repetition.

Substituting the values in the formula, we get:

4P4 = 4! / (4-4)! = 4! / 0! = 4 x 3 x 2 x 1 / 1 = 24

However, this formula counts all possible permutations, including those where the order of entries is the same as the original stack. To eliminate these permutations, we need to subtract 1 from the total number of permutations.

Therefore, the number of possible permutations when stack A has 4 distinct entries is:

4P4 - 1 = 24 - 1 = 23

This is still not the correct answer given in option 'D', which is 14. Therefore, there must be some additional constraint or information given in the problem that limits the number of possible permutations to 14.

Without further information, it is not possible to determine what this constraint or information is.
Free Test
Community Answer
Astack Ahas 4 entries as following sequence a,b,c,d andstack Bis empty...
In the previous problem stack a has 4

4 is let x = 4x power of 2 is 16 2 suquare is 4
16 minus 2
14 ans
Explore Courses for Computer Science Engineering (CSE) exam
Question Description
Astack Ahas 4 entries as following sequence a,b,c,d andstack Bis empty. An entry popped out of stack A can be printed or pushed to stack B. An entry popped out of stack B can only be printed.Then the number of possiblepermutationsthat the entriescan be printed will be?a)24b)12c)21d)14Correct answer is option 'D'. Can you explain this answer? for Computer Science Engineering (CSE) 2025 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Astack Ahas 4 entries as following sequence a,b,c,d andstack Bis empty. An entry popped out of stack A can be printed or pushed to stack B. An entry popped out of stack B can only be printed.Then the number of possiblepermutationsthat the entriescan be printed will be?a)24b)12c)21d)14Correct answer is option 'D'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Astack Ahas 4 entries as following sequence a,b,c,d andstack Bis empty. An entry popped out of stack A can be printed or pushed to stack B. An entry popped out of stack B can only be printed.Then the number of possiblepermutationsthat the entriescan be printed will be?a)24b)12c)21d)14Correct answer is option 'D'. Can you explain this answer?.
Solutions for Astack Ahas 4 entries as following sequence a,b,c,d andstack Bis empty. An entry popped out of stack A can be printed or pushed to stack B. An entry popped out of stack B can only be printed.Then the number of possiblepermutationsthat the entriescan be printed will be?a)24b)12c)21d)14Correct answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Astack Ahas 4 entries as following sequence a,b,c,d andstack Bis empty. An entry popped out of stack A can be printed or pushed to stack B. An entry popped out of stack B can only be printed.Then the number of possiblepermutationsthat the entriescan be printed will be?a)24b)12c)21d)14Correct answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Astack Ahas 4 entries as following sequence a,b,c,d andstack Bis empty. An entry popped out of stack A can be printed or pushed to stack B. An entry popped out of stack B can only be printed.Then the number of possiblepermutationsthat the entriescan be printed will be?a)24b)12c)21d)14Correct answer is option 'D'. Can you explain this answer?, a detailed solution for Astack Ahas 4 entries as following sequence a,b,c,d andstack Bis empty. An entry popped out of stack A can be printed or pushed to stack B. An entry popped out of stack B can only be printed.Then the number of possiblepermutationsthat the entriescan be printed will be?a)24b)12c)21d)14Correct answer is option 'D'. Can you explain this answer? has been provided alongside types of Astack Ahas 4 entries as following sequence a,b,c,d andstack Bis empty. An entry popped out of stack A can be printed or pushed to stack B. An entry popped out of stack B can only be printed.Then the number of possiblepermutationsthat the entriescan be printed will be?a)24b)12c)21d)14Correct answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Astack Ahas 4 entries as following sequence a,b,c,d andstack Bis empty. An entry popped out of stack A can be printed or pushed to stack B. An entry popped out of stack B can only be printed.Then the number of possiblepermutationsthat the entriescan be printed will be?a)24b)12c)21d)14Correct answer is option 'D'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam
Signup to solve all Doubts
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev