P4 LinkedList
P4 LinkedList
P4 LinkedList
Problem Statement :
For the given singly linked list swap the elements.eg. if the given list is 1 2 3 4 5 then the list will
become 2 1 4 3 5
Program :
#include <stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node* next;
};
int main() {
struct Node* head = NULL;
int n;
int data;
swap(head);
freeList(head);
return 0;
}
Output :