C-Dynamic Memory Allocation and Data Structure Questions and Answers

Practice Mode
Showing 10 of 104 questions
Q81
The operation for removing an entry from a stack is traditionally called:
  • A Delete
  • B Peek
  • C Pop
  • D Remove
Answer: Option C
Q82
Which of the following applications may use a stack ?
  • A a parentheses balancing program.
  • B Keeping track of local variables at run time.
  • C syntax analyzer for a compiler
  • D All of the above.
Answer: Option D
Q83
Which of the following stack operations could result in stack undeflow/
  • A is_empty
  • B Pop
  • C Push
  • D Two or more of the above answers
Answer: Option B
Q84
Consider the well formed strings : (( )) (( )) ( ) ) and not well formed strings: ( ( ). Which of the data structure can be implemented to solve the problem:
  • A Stacks
  • B Queue
  • C Trees
  • D Graph
Answer: Option A
Q85
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"?
  • A serc
  • B carpets
  • C steprac
  • D ccaarrppeettss
Answer: Option C
Q86
the postfx notation is also called
  • A Reverse polish notation
  • B Posish notation
  • C Infix notation
  • D None of these
Answer: Option A
Q87
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 ?
  • A 1
  • B 2
  • C 3
  • D 4
Answer: Option B
Q88
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: ( ) ) ( ( )) ( ( )) )
  • A 1
  • B 2
  • C 3
  • D 4
Answer: Option C
Q89
Adding an element to the stack means
  • A Placing an element at the front end
  • B Placing the element at the top
  • C Placing the element at the rear end
  • D None of these
Answer: Option B
Q90
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?
  • A data [0]
  • B data [1]
  • C data [9]
  • D data [10]
Answer: Option D
Questions and Answers for Competitive Exams Various Entrance Test