Tag: Linked list
Deleting a Node from Linked List
Problem statement: Given a number, delete the first occurrence of that number in the linked list.
Iterative Solution
1) Find the previous node of the node...
Search an Element in a Linked List
Problem Statement: Search an element in a Linked List
i) Iterative solution
ii) Recursive solution
Iterative Solution
1) Initialize temp node to head
2) while temp is not NULL
a)...
Linked List Insertion Set 1
Adding a Node in Singly Linked List
1) at the Beginning
2) at the end
3) at a specific location
Inserting a Node at the beginning of the...
Create a Linked List
/*C code to create and print the Linked List*/
#include <stdio.h>
#include <stdlib.h>
typedef struct node
{
int data;
struct node *next;
} NODE;
NODE *head = NULL;
NODE *newNodeF(int key)
{
NODE *temp =...
Linked List Traversal
The printList() function takes a linked list as input and prints the elements of the list till NULL pointer is encountered. Here the traversal...
Linked List
A Linked List is the data structure that consists of nodes containing data and a pointer to the next node.
- The node points to...