📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    Consider a stack implemented using a fixed-size array in

    C or Java. What is the primary concern when performing a push operation?
    A Memory fragmentation. Correct Answer Incorrect Answer
    B Stack underflow. Correct Answer Incorrect Answer
    C Array index out of bounds (stack overflow). Correct Answer Incorrect Answer
    D Inefficient memory allocation. Correct Answer Incorrect Answer
    E Cache miss penalty. Correct Answer Incorrect Answer

    Solution

    When a stack is implemented using a fixed-size array, pushing an element onto a full stack will attempt to access an index beyond the array's bounds, leading to a stack overflow error.

    Practice Next
    ask-question