Computer Science · Data Structures
Consider the following two C++ statements and their contexts: (a) return P->next == NULL; // P is a pointer to an element in a singly linked list L. (b) return S->next == NULL; // S is a stack implemented as a singly linked list. If the return value is TRUE in both cases, which of the following is correct?
- 1P points to the last element in L, and S is empty.✓
- 2P points to the last element in L, and S is full.
- 3L is empty, and S is full.
- 4Both L and S are empty.
Correct answer
P points to the last element in L, and S is empty.
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Data Structures?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · Data Structures