Skip to content

Category Archives: Linked List

Given a sorted linked list, delete all nodes that have duplicate numbers (all occurrences), leaving only numbers that appear once in the original list. Examples: Input:… Read More
Given a linked list, write a function to reverse every alternate k nodes (where k is an input to the function) in an efficient way.… Read More
Given a singly linked list of characters, write a function that returns true if the given list is a palindrome, else false. Recommended: Please solve… Read More
Given a singly linked list, swap kth node from beginning with kth node from end. Swapping of data is not allowed, only pointers should be… Read More
There are two singly linked lists in a system. By some programming error, the end node of one of the linked list got linked to… Read More
An array in C/C++ or be it in any programming language is a collection of similar data items stored at contiguous memory locations and elements… Read More
Given a linked list of coordinates where adjacent points either form a vertical line or a horizontal line. Delete points from the linked list which… Read More
Given a singly linked list, delete the middle of the linked list. For example, if the given linked list is 1->2->3->4->5 then the linked list… Read More
Given a root of the Binary Tree and head of the Linked List, the task is to check if all the elements of the linked… Read More
Given root of the Binary Tree T and a linked list L, the task is to find the direction of path followed from root such… Read More
Given three linked lists, say a, b and c, find one node from each list such that the sum of the values of the nodes… Read More
Given a singly linked list, write a function to swap elements pairwise. For example, if the linked list is 1->2->3->4->5->6->7 then the function should change… Read More
Given a singly linked list, write a function to swap elements pairwise. For example, if the linked list is 1->2->3->4->5->6->7 then the function should change… Read More
Given a doubly linked list, write a function to sort the doubly linked list in increasing order using merge sort.For example, the following doubly linked… Read More
Given two Linked Lists, create union and intersection lists that contain union and intersection of the elements present in the given lists. The order of… Read More

Start Your Coding Journey Now!