Consider the following two C++ statements and the accompanying contexts. (a)…
NVS Computer Science / IT Teacher Recruitment · 2022 · PGT Computer Science · 15 Dec 2022 · Shift 2 · Computer Science or Information Technology
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 the dummy head (sentinel) of a stack implemented as a linked list.
If the return value is TRUE in both cases, which of the following is correct?
- A.
P points to the last element in L and S is empty.
- B.
P points to the last element in L and S is full.
- C.
L is empty and S is full.
- D.
Both L and S are empty.
Attempted by 25 students.
Sign up free to check your answer
Sign up freeLoading lesson…