238 views
3 3 votes

Consider the following singly linked list:

$\texttt{'B' -> 'A' -> 'S' -> 'E' -> NULL}$

The pointer $\texttt{head}$ points to the first node containing $\texttt{'B'}$.

What character is stored in the node pointed to by the following expression?

$\texttt{head->next->next}$

  1. $\texttt{NULL}$
     
  2. $\texttt{A}$
     
  3. $\texttt{S}$
     
  4. $\texttt{E}$

3 Answers

0 0 votes

$\texttt{head}$ points to node $\texttt{'B'}$.

$\texttt{head->next}$ points to node $\texttt{'A'}$.

$\texttt{head->next->next}$ points to node $\texttt{'S'}$.

Answer : C

Answer:
Position:
Show:

Related questions

6 6 votes
2 2 answers
246
246 views
GO Classes asked Jul 4
246 views
A singly linked list maintains two pointers:struct Node *front; // points to first node struct Node *rear; // points to last nodeWhich operation would be inefficient when...
9 9 votes
2 2 answers
258
258 views
GO Classes asked Jul 4
258 views
Consider the problem of finding the middle node in a list $l$ of size $n$, given that $n$ is odd. Count the number of accesses to positions of list $l$ needed to find the...
7 7 votes
4 4 answers
255
255 views
GO Classes asked Jul 4
255 views
Consider the following C function intended to delete the last node of a singly linked list:void removeLast(struct Node *head) { struct Node *p = head; struct Node *q = p-...
6 6 votes
3 3 answers
248
248 views
GO Classes asked Jul 4
248 views
Consider the following structure:struct Node { int data; struct Node *next; };A function should insert a new node containing value $\texttt{x}$ at the beginning of a sing...