Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Stack A has the entries as following sequence... Start Learning for Free
Stack A has the entries as following sequence a, b, c (with ‘a’ on top), Stack B is empty, as shown in the diagram below.




Q. Considering the data given in the previous question, if the stack A had 4 entries, then the number of possible permutations that 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
Stack A has the entries as following sequence a, b, c (with ‘a&r...
 


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
Explore Courses for Computer Science Engineering (CSE) exam
Question Description
Stack A has the entries as following sequence a, b, c (with ‘a’ on top), Stack B is empty, as shown in the diagram below.Q.Considering the data given in the previous question, if the stack A had 4 entries, then the number of possible permutations that can 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 Stack A has the entries as following sequence a, b, c (with ‘a’ on top), Stack B is empty, as shown in the diagram below.Q.Considering the data given in the previous question, if the stack A had 4 entries, then the number of possible permutations that can 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 Stack A has the entries as following sequence a, b, c (with ‘a’ on top), Stack B is empty, as shown in the diagram below.Q.Considering the data given in the previous question, if the stack A had 4 entries, then the number of possible permutations that can be printed will be:a)24b)12c)21d)14Correct answer is option 'D'. Can you explain this answer?.
Solutions for Stack A has the entries as following sequence a, b, c (with ‘a’ on top), Stack B is empty, as shown in the diagram below.Q.Considering the data given in the previous question, if the stack A had 4 entries, then the number of possible permutations that can 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 Stack A has the entries as following sequence a, b, c (with ‘a’ on top), Stack B is empty, as shown in the diagram below.Q.Considering the data given in the previous question, if the stack A had 4 entries, then the number of possible permutations that can 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 Stack A has the entries as following sequence a, b, c (with ‘a’ on top), Stack B is empty, as shown in the diagram below.Q.Considering the data given in the previous question, if the stack A had 4 entries, then the number of possible permutations that can be printed will be:a)24b)12c)21d)14Correct answer is option 'D'. Can you explain this answer?, a detailed solution for Stack A has the entries as following sequence a, b, c (with ‘a’ on top), Stack B is empty, as shown in the diagram below.Q.Considering the data given in the previous question, if the stack A had 4 entries, then the number of possible permutations that can be printed will be:a)24b)12c)21d)14Correct answer is option 'D'. Can you explain this answer? has been provided alongside types of Stack A has the entries as following sequence a, b, c (with ‘a’ on top), Stack B is empty, as shown in the diagram below.Q.Considering the data given in the previous question, if the stack A had 4 entries, then the number of possible permutations that can 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 Stack A has the entries as following sequence a, b, c (with ‘a’ on top), Stack B is empty, as shown in the diagram below.Q.Considering the data given in the previous question, if the stack A had 4 entries, then the number of possible permutations that can 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