C-Dynamic Memory Allocation and Data Structure Questions and Answers

Practice Mode
Showing 10 of 104 questions
Q91
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?
  • A Both peek and pop would require linear time.
  • B Both push and pop would require linear time.
  • C the stack could not be used to check balanced parentheses.
  • D The stack could not be used to evaluate postfi expressions.
Answer: Option C
Q92
In the linked-list version of the stack class, which operations require linear time for their worst-case behavior?
  • A is_empty
  • B peek
  • C push
  • D None of these opertions require linear time.
Answer: Option D
Q93
In the linked list implementation of the stack class, where does the push member function place the new entry on the linked list?
  • A At the head
  • B At the tail
  • C After all other entries that are greater than the new entry.
  • D After all other entries that are smaller than the new entry
Answer: Option A
Q94
What is the value of the postfix expression 6 3 2 4 + -*:
  • A Something between -15 and -10
  • B Something between -5 and -15
  • C Something between 5 and -5
  • D Something between 5 and 15
Answer: Option A
Q95
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?
  • A 1
  • B 2
  • C 3
  • D 4
Answer: Option D
Q96
Apliction of stacks is/are
  • A Temporary store of data
  • B Used withinterrupts in Operating Systems,
  • C Reversing items in a list
  • D All of the above
Answer: Option C
Q97
What will be the equivalent prefix expressio of postfix form 4 2 $ 3 * 3 - 8 4 / 1 1 + / +
  • A + - * $ 4 2 3 3 / / 8 4 + 1 1
  • B $ * + - 4 2 3 3 / / 8 4 + 1 1
  • C * + - $ 4 2 3 3 / / 8 4 + 1 1
  • D - + * $ 4 2 3 3 / / 8 4 + 1 1
Answer: Option A
Q98
Equivalent postfix expression of : (7 -) * (9 / 2)
  • A 7 5 9 2 * / -
  • B 7 5 9 2 / * -
  • C 7 5 -9 2 / *
  • D 7 5 9 2- / *
Answer: Option C
Q99
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.
  • A 4
  • B 3
  • C 2
  • D 5
Answer: Option C
Q100
give the infix implementation of post fix: a b + c *d e - -f g + $:
  • A ( (a+ b) * c-(d-e) $ (f+g).
  • B (a + b) * c) - (c - d) - e $ (f + g)
  • C ((a + b) * (c-d) -e) $ (f+g)
  • D (a (b *c) -c - (d -e))) $ (f + g)
Answer: Option A
Questions and Answers for Competitive Exams Various Entrance Test