Consider the following two C++ statements and the accompanying contexts.
Consider the following two C++ statements and the accompanying contexts.
(A) return P→next = = NULL; // P is a pointer to an element in the link list L.
(B) return S → next == NULL; // S is a stack implemented as a link list.
If the return value is TRUE in both cases, which of the following is correct ?
Show answerHide answer
Correct answer: (B) P points to the last element in L and S is full.
Explanation
Answer as per the book's key (b). Note that S→next == NULL would normally mean the stack is empty, so this question is doubtful.