KnowledgeBoat Logo

Computer Science

Assertion (A): An error gets displayed when you try to delete an element from an empty Stack.

Reasoning (R): Inserting an element when the Stack is full is termed as Underflow.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.

Python Stack

2 Likes

Answer

A is true but R is false.

Explanation
When we attempt to delete an element from an empty stack, it results in an error known as an underflow error. This occurs because the stack is empty, and there's no element to remove. On the other hand, inserting an element when the stack is full is termed as an overflow condition.

Answered By

1 Like


Related Questions