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?

  1. A.

    P points to the last element in L and S is empty.

  2. B.

    P points to the last element in L and S is full.

  3. C.

    L is empty and S is full.

  4. D.

    Both L and S are empty.

Attempted by 25 students.

Sign up free to check your answer

Sign up free

Explore the full course: Rssb Senior Computer Instructor

Loading lesson…