Build and modify a singly linked list with insertion operations!
Hi! I'm Teju 👋 First, we receive existing student roll numbers (end with -1).
Then, we perform operations to insert new students:
• 1 X: Insert X at beginning
• 2 X: Insert X at end
• 3 P X: Insert X at position P (1-based)
Stop with -1.
Part 1: Initial roll numbers → end with -1
Part 2: Operations (1 X / 2 X / 3 P X) → end with -1
Output: Final linked list in order
We support three types of insertions on the singly linked list:
Example: "1 5" inserts 5 at the beginning
Waiting for initial roll numbers...
Linked List Elements: