# Data Structures - Stacks

6:   Which of the following types of expressions does not require precedence rule when evaluated?
 A. Full parenthesized infix expression B. Prefix expression C. Partially parenthesized infix expression D. More than one of these Answer Report Discuss Option: D Explanation : Click on Discuss to view users comments. bhawna said: (10:11am on Monday 29th July 2013) why d option ? why not a? Write your comments here:
7:

The five items:A,B,C,D, and E are pushed in a stack, one after the other starting from A.The stack is popped four times and each element is inserted in a queue.Then two elements are deleted from the queue and pushed back on the stack.Now one item is popped from the stack.
The popped item is

 A. E B. B C. C D. D Answer Report Discuss Option: D Explanation : In queue elements are deleted from front (FIFO) and in stacks elements are popped from top (LIFO) Click on Discuss to view users comments. silpa said: (10:32pm on Thursday 2nd July 2015) the first popped element from stack is 'e' then 'd','c','b' respectively.According to FIFO,first inserted element(e)is deleted first then 'd' is also deleted. then how become 'd' is answer?? Write your comments here:
8:

If memory for the run-time stack is only 150 cells(words), how big can N be in Factorial(N) before encounterring stack overflow?

 A. 24 B. 12 C. 26 D. 50 Answer Report Discuss Option: C Explanation : Given that, the size of a run time stack is of 150 cells (words). The arguments to be evaluate the factorial are placed on the stack. A function call is made to calculate the factorial. Subroutine is executed for each time the function call is made. Each funcall creates a stack frames of co words (Cells), 2 words for n, 2 words for program counter (PC) and 2 words for some other information. The value of n should be such that, the size of stack should not exceed 150 cells. If we consider the value of n to be 26, it executes 25 procedure calls each of it with 6-word stack frame. In this case totalnumber of words of stack space would be 150 (6 words × 25 procedure calls = 150) cells. Therefore, value of n will be 26 is n! before encountering a stack overflow for the stack of size 150 cells (words) Click on Discuss to view users comments. rama said: (10:07pm on Wednesday 13th February 2013) please explain how 66 and also if factorial is using recursion or simple. Write your comments here:
9:

Using
Pop(S1, Item)
Push(S1,Item)
Print(Item)
the variables S1 represents (stack) and Item are  given the input file:

A,B,C,D,E,F  <EOF>

Which stacks are possible:

 A. 5       A 4       B 3       C 2       D 1       E B. 5   4   3      D 2      A 1      F C. 5 4     3      F 2      D 1      B D. 5 4 3     C 2     E 1     B Answer Report Discuss Option: C Explanation : Click on Discuss to view users comments. Write your comments here:
10:

Using Pop (S1,Item) ,Push(S1, Item),  Getlist(Item), Pop(S2,Item), and the variables S1,S2(stacks with Top1 and Top2) and Item and given the input file: A,B,C,D,E,F Which stack are possible?

 A. All possible stacks with A,B,C,D,E and F B. No possible stacks with A,B,C,D,E and F C. Exact and only those stacks which can be produced with S1 alone D. Twice as many stacks as can be produced with S1 alone Answer Report Discuss Option: A Explanation : Click on Discuss to view users comments. Write your comments here:

Syllabus covered in this section is-

• Abstract data types
• Algorithms
• Stacks, Queues
• Trees, Binary search trees
• Binary heaps

This Section covers Data Structures Questions Answers using C language .
Who can benefit -

• Any student who is pursuing B.Sc. in Information Technology can also use this Data Structures mcq section.
• Data Structures MCQs can also be used by any student who is pursuing any undergraduate or postgraduate degree in Computer Science.
• Any candidate who has to appear for DOEACC A, B or C level Exam can also use Data Structures Questions Answers to gain credits in their exams.
• Candidates appearing for Kendriya Vidyalya Sangathan Entrance Exam can also use Data Structures Multiple Choice Questions Answers for the preparation of their exams.
• Data Structures Questions Answers can also be used by MCA students for the preparation of their exams.
• You can also get Data Structures mcq pdf if you purchase an e-book from site.

Various Search Terms used for this section are