🔔 Student Registration System

Build and modify a singly linked list with insertion operations!

🎯 Problem: Dynamic Student Registration

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

🔧 Supported Operations

We support three types of insertions on the singly linked list:

Operation Details:

  1. 1 X → Insert X at the beginning (new head)
  2. 2 X → Insert X at the end (after last node)
  3. 3 P X → Insert X before position P (1-based index)
  4. -1 → Stop all operations
5
10
20
30
null

Example: "1 5" inserts 5 at the beginning

🎮 Interactive Demo

Waiting for initial roll numbers...

Empty List → null

📋 Final Student Registration List