C-Dynamic Memory Allocation and Data Structure

C-Dynamic Memory Allocation and Data Structure
81. The operation for removing an entry from a stack is traditionally called:
  • Delete
  • Peek
  • Pop
  • Remove
Show Answer
82. Which of the following applications may use a stack ?
  • a parentheses balancing program.
  • Keeping track of local variables at run time.
  • syntax analyzer for a compiler
  • All of the above.
Show Answer
83. Which of the following stack operations could result in stack undeflow/

  • is_empty
  • Pop
  • Push
  • Two or more of the above answers
Show Answer
84. Consider the well formed strings : (( )) (( )) ( ) ) and not well formed strings: ( ( ). Which of the data structure can be implemented to solve the problem:
  • Stacks
  • Queue
  • Trees
  • Graph
Show Answer
85. Consider the following pseudocode:
declare a stack of characters
while (there are more characters in the word to read)
{
read a character
push the character on the stack
}
while (the stack is not empty)
{
write thestack's top character to the screen
pop a character off the stack
}
What is written to the screen for the imput "carpets"?

  • serc
  • carpets
  • steprac
  • ccaarrppeettss
Show Answer
86. the postfx notation is also called
  • Reverse polish notation
  • Posish notation
  • Infix notation
  • None of these
Show Answer
87. Consider th usual algorithm for determining whether a sequence of parentheses is balanced. suppose that contains 2 left parentheses and 3 right parentheses (in some order). What is the maximum number of parentheses that will ever appear on the stack AT ON TIME during the computation ?
  • 1
  • 2
  • 3
  • 4
Show Answer
88. Consider the usual algorithm for determining whether a sequence of parentheses is balanced. Wht is the maimum numbef of parentheses that will appear on the stack AT ANY ONE TIME when the algorithm analyzes: ( ) ) ( ( )) ( ( )) )
  • 1
  • 2
  • 3
  • 4
Show Answer
89. Adding an element to the stack means
  • Placing an element at the front end
  • Placing the element at the top
  • Placing the element at the rear end
  • None of these
Show Answer
90. Suppose we have an array implementation of the stack class, with ten items in the stack stored at data [0] through data [9]. The CAPACITY is 42. where does the push member function place the new entry in the aray?
  • data [0]
  • data [1]
  • data [9]
  • data [10]
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test