MCQ · 1 mark · Linear Data Structures

GATE CS 2017 CS-1 — Q8

Consider the C code fragment given below.
typedef struct node {
    int data;
    node* next;
} node;

void join(node* m, node* n) {
    node* p = n;
    while (p->next != NULL) {
        p = p->next;
    }
    p->next = m;
}
Assuming that mm and nn point to valid NULL-terminated linked lists, invocation of join will
Select one option