Skip to main content

Posts

Featured

singly linked list (deletion)

 What is a singly linked list? A singly-linked list generally known as a linked list consists of two parts, one is data that holds the actual data which we use and the other one is a pointer that refers to the memory location of the next node deletion from a singly linked list: Deletion in a singly linked list can be performed in different ways Deletion from the beginning of the singly linked list. Deletion from the Nth position. Deletion from the end in the singly linked list. In this article, we will discuss how to perform these types of insertions  deletion from beginning in a singly linked list: void insertatStart(int value) { Node* newNode = new Node(); newNode->data = value; newNode->next = head; head=newNode; } deletion from the end in a singly linked list: void insertatEnd(int value) { Node*newNode = new Node(); newNode->data = value; newNode->next = nullptr; if (head == nullptr) { head = newNode; } else { Node*t = head; ...

Latest Posts

deletion in a doubly linked list:

doubly linked list(insertion)

Insertion in a singly linked list