C-Dynamic Memory Allocation and Data Structure

C-Dynamic Memory Allocation and Data Structure
91. Consider the implementation of the stack using  partially-filled array. What goes wrong if we try tos store the top of the stack at location [0] and the bottom of the stack at the last used position of the array?
  • Both peek and pop would require linear time.
  • Both push and pop would require linear time.
  • the stack could not be used to check balanced parentheses.
  • The stack could not be used to evaluate postfi expressions.
Show Answer
92. In the linked-list version of the stack class, which operations require linear time for their worst-case behavior?
  • is_empty
  • peek
  • push
  • None of these opertions require linear time.
Show Answer
93. In the linked list implementation of the stack class, where does the push member function place the new entry on the linked list?
  • At the head
  • At the tail
  • After all other entries that are greater than the new entry.
  • After all other entries that are smaller than the new entry
Show Answer
94. What is the value of the postfix expression 6 3 2 4 + -*:

  • Something between -15 and -10
  • Something between -5 and -15
  • Something between 5 and -5
  • Something between 5 and 15
Show Answer
95. Here is an infix expression: 4+3* (6*3-12).
suppose that we are using the usual stack algorithm to convert the expression from infix to postfix notation. What is the maximum number of symbols that will appear on the stack AT ONE TIME during the conversion of this expression?
  • 1
  • 2
  • 3
  • 4
Show Answer
96. Apliction of stacks is/are
  • Temporary store of data
  • Used withinterrupts in Operating Systems,
  • Reversing items in a list
  • All of the above
Show Answer
97. What will be the equivalent prefix expressio of postfix form
4 2 $ 3 * 3 - 8 4 / 1 1 + / +
  • + - * $ 4 2 3 3 / / 8 4 + 1 1
  • $ * + - 4 2 3 3 / / 8 4 + 1 1
  • * + - $ 4 2 3 3 / / 8 4 + 1 1
  • - + * $ 4 2 3 3 / / 8 4 + 1 1
Show Answer
98. Equivalent postfix expression of : (7 -) * (9 / 2)
  • 7 5 9 2 * / -
  • 7 5 9 2 / * -
  • 7 5 -9 2 / *
  • 7 5 9 2- / *
Show Answer
99. During the conversion of infix expression 4 $ 2 * 3 - 38 / 4 (1 + 1) to post fix, what is the maximum number of symbol (operators) in the stack content at one point of time.
  • 4
  • 3
  • 2
  • 5
Show Answer
100. give the infix implementation of post fix: a b + c *d e - -f g + $:
  • ( (a+ b) * c-(d-e) $ (f+g).
  • (a + b) * c) - (c - d) - e $ (f + g)
  • ((a + b) * (c-d) -e) $ (f+g)
  • (a (b *c) -c - (d -e))) $ (f + g)
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test