C-Dynamic Memory Allocation and Data Structure Questions and Answers

Take Exam

Data Structure and Algorithms questions with answers are crucial for technical interviews and competitive exams like GATE, Infosys, and TCS. This topic tests understanding of arrays, linked lists, stacks, queues, trees, and sorting algorithms. Programming interview questions with answers in this section focus on time complexity, optimization, and problem-solving efficiency. Practicing DSA MCQs strengthens core programming logic, helping candidates excel in both written tests and coding interviews.

Detailed questions on dynamic memory use. For further practice, try database data models and data structures algorithms

C-Dynamic Memory Allocation and Data Structure

Showing 10 of 104 questions

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 Report

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 Report

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 Report

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 Report

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 Report

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 Report

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 Report

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 Report

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 Report

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 Report
Questions and Answers for Competitive Exams Various Entrance Test