Given a Singly Linked List, starting from the second node delete all alternate nodes of it. For example, if the given linked list is 1->2->3->4->5… Read More
Given two lists sorted in increasing order, create and return a new list representing the intersection of the two lists. The new list should be… Read More
Write a function to delete a given node in a doubly-linked list.  Example: Input: DLL = 2->45->3->1, Node = 45Output:  2->3->1 Input: DLL = 2->45->3->1,… Read More
Given a singly linked list, write a function to swap elements pairwise.  Input : 1->2->3->4->5->6->NULL Output : 2->1->4->3->6->5->NULL Input : 1->2->3->4->5->NULL Output : 2->1->4->3->5->NULL Input : 1->NULL Output… Read More
Write a function that moves the last node to the front in a given Singly Linked List. Examples: Input: 1->2->3->4->5Output: 5->1->2->3->4 Input: 3->8->1->5->7->12Output: 12->3->8->1->5->7  … Read More
Assume the structure of a Linked List node is as follows.  C++ struct Node {   int data;   struct Node *next; };   // This code… Read More
Original Linked List Result Linked List 1 Result Linked List 2 If there are odd number of nodes, then first list should contain one extra.… Read More