0
Consider the given memory representation of the singly linked list where start points to the address of first node of the linked list, which is memory location 0.
Memory representation of the singly linked list
| Memory location | Item value | Pointer to the next element |
|---|---|---|
| 0 | A | 4 |
| 1 | E | 2 |
| 2 | B | NULL |
| 3 | ||
| 4 | C | 1 |
If a new node whose data value is X is inserted after the node whose data value is E in any free location available in the memory, then what will the memory representation be after inserting the new node?
- A
Memory representation of the linked list after inserting node X
Memory location Item value Pointer to the next element 0 A 4 1 E 2 2 B NULL 3 X 1 4 C 3 - B
Memory representation of the linked list after inserting node X
Memory location Item value Pointer to the next element 0 A 4 1 E 3 2 B NULL 3 X 2 4 C 1 - C
Memory representation of the linked list after inserting node X
Memory location Item value Pointer to the next element 0 A 3 1 E 2 2 B NULL 3 X 4 4 C 1 - D
Memory representation of the linked list after inserting node X
Memory location Item value Pointer to the next element 0 A 4 1 E 2 2 B 3 3 X NULL 4 C 1
Correct answer: B