Consider the given memory representation of singly linked list where start points to the address of the starting node of the linked list, which is in memory…
Consider the given memory representation of singly linked list where start points to the address of the starting node of the linked list, which is in memory location 0.
Memory representation of the linked list
Memory location | Item value | Pointer to next element
0 | A | 4
1 | E | 3
2 | B | NULL
3 | X | 2
4 | C | 1
If you traverse all the elements from the given linked list, then which of the following is correct order?
Show answerHide answer
Correct answer: (D) A, C, E, X, B
Explanation
Start at location 0 (A, next 4), then 4 (C, next 1), 1 (E, next 3), 3 (X, next 2), 2 (B, next NULL). So the order is A, C, E, X, B.