RLINK is the pointer pointing to the _______

RLINK is the pointer pointing to the

A. last node

B. head node

C. successor node

D. predecessor node

Answer: successor node

RLINK (right link) is the pointer pointing to the successor node. It is used to traverse the linked list in forwarding direction.

LLINK (left link) is used to traverse the linked list in the backward direction. It can also be used to implement a stack, by maintaining a pointer to the top of the stack called TOP.

The l_link points to the previous node in the list and the r_link points to the successor node in the list. So, if you need to find the successor of a given node, then you can get it by using its r_link. Similarly, if you need to find the predecessor of a given node, then you can get it by using its l_link.

2 – Linked List Types

A linked list is either singly or doubly linked:

Singly Linked List: In a singly linked list, each node has only one link which points to the next node in the sequence. Here we cannot traverse backward.

Doubly Linked List: In a doubly-linked list, each node has two links – one pointing to the previous node and the other pointing to the next node in the sequence. Hence we can traverse backward also.

Comments