typedef struct list {
int data;
struct list next;
} LIST;
Suppose a program has created two linked lists, L1 and L2, whose contents are given in the figure below (code for creating L1 and L2 is not provided here). L1 contains 9 nodes, and L2 contains 7 nodes.
Consider the following C program segment that modifies the list L1. The number of nodes that will be there in L1 after the execution of the code segment is:Comparing the two lists:
After excluding the common elements, L1 contains exactly five values.
Hence, the number of nodes left in L1 is \(\boxed{5}\).
| LIST I | LIST II |
|---|---|
| (A) Circular Linked List | (I) Recursive Function Calls |
| (B) Doubly Linked List | (II) Round Robin Queue in CPU |
| (C) Stack | (III) Hash Tables |
| (D) Singly Linked List | (IV) Undo and Redo Functionality |