1.

Array implementation of Stack is not dynamic, which of the following statements supports this argument?(a) space allocation for array is fixed and cannot be changed during run-time(b) user unable to give the input for stack operations(c) a runtime exception halts execution(d) improper program compilationMy question comes from Stack using Array topic in division Abstract Data Types of Data Structures & Algorithms IThe question was posed to me in my homework.

Answer» RIGHT option is (a) space allocation for array is FIXED and cannot be changed during run-time

For explanation: You cannot modify the SIZE of an array once the MEMORY has been allocated, ADDING fewer elements than the array size would cause wastage of space, and adding more elements than the array size at run time would cause Stack Overflow.


Discussion

No Comment Found

Related InterviewSolutions