Answer
See the explanation
Work Step by Step
The correct routine for inserting NewEntry immediately after the entry called PreviousEntry in a linked list is Routine 1.
Explanation:
Routine 1 correctly inserts NewEntry into the linked list by following these steps:
1. Copy the value in the pointer field of PreviousEntry into the pointer field of NewEntry.
2. Change the value in the pointer field of PreviousEntry to the address of NewEntry.
This sequence of steps ensures that the NewEntry is properly inserted after the PreviousEntry in the linked list. By copying the value in the pointer field of PreviousEntry into the pointer field of NewEntry, the link between PreviousEntry and the subsequent entry is preserved. Then, by changing the value in the pointer field of PreviousEntry to the address of NewEntry, the link between PreviousEntry and NewEntry is established.
On the other hand, Routine 2 is incorrect because it swaps the order of the steps:
1. Change the value in the pointer field of PreviousEntry to the address of NewEntry.
2. Copy the value in the pointer field of PreviousEntry into the pointer field of NewEntry.
In Routine 2, the link between PreviousEntry and the subsequent entry is lost before it is copied into the pointer field of NewEntry. This results in the loss of the original link and the incorrect insertion of NewEntry into the linked list. Therefore, Routine 2 is not a correct way to insert NewEntry immediately after PreviousEntry in a linked list.