Given two linked lists sorted in increasing order. Merge them such a way that the result list is in decreasing order (reverse order). Examples: Input:… Read More
Category Archives: Linked List
Given two linked lists sorted in increasing order. Merge them such a way that the result list is in decreasing order (reverse order). Examples: Input:… Read More
Given a singly linked list, Your task is to remove every K-th node of the linked list. Assume that K is always less than or… Read More
QuickSort on Doubly Linked List is discussed here. QuickSort on Singly linked list was given as an exercise. The important things about implementation are, it… Read More
Write a function to count the number of nodes in a given singly linked list. For example, the function should return 5 for linked list… Read More
Given a Singly Linked List, write a function to delete a given node. Your function must follow the following constraints: It must accept a pointer… Read More
Given a Linked List and a number n, write a function that returns the value at the n’th node from the end of the Linked… Read More
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 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