Create a linked list to store and display the elements.
HardProblem Statement
Create a linked list to store and display the elements.
Sample Input
elements = {5, 10, 15}Sample Output
5 -> 10 -> 15
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
#include <stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node *next;
};
int main() {
struct Node *head = NULL;
// Logic to add elements and display the list
return 0;
}
Input
elements = {5, 10, 15}Expected Output
5 -> 10 -> 15