Skip to content

Category Archives: Linked List

You are given a Double Link List with one pointer of each node pointing to the next node just like in a single link list.… Read More
Asked by Varun Bhatia. Question: Write a recursive function treeToList(Node root) that takes an ordered binary tree and rearranges the internal pointers to make a… 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 PracticeCheck… Read More
Given a linked list, check if the linked list has loop or not. Below diagram shows a linked list with a loop.  Recommended: Please solve… Read More
Given a pointer to the head node of a linked list, the task is to reverse the linked list. We need to reverse the list… Read More
A simple solution is to traverse the linked list until you find the node you want to delete. But this solution requires a pointer to… Read More
Given a singly linked list and a key, count the number of occurrences of the given key in the linked list. For example, if the… Read More
Algorithm For C/C++: Iterate through the linked list and delete all the nodes one by one. The main point here is not to access the… Read More
Given a singly linked list, find the middle of the linked list. For example, if the given linked list is 1->2->3->4->5 then the output should… Read More
Given a pointer to a node to be deleted, delete the node. Note that we don’t have a pointer to the head node. Recommended PracticeDelete… Read More
Write a GetNth() function that takes a linked list and an integer index and returns the data value stored in the node at that index… Read More
Write a function detectAndCountLoop() that checks whether a given Linked List contains loop and if loop is present then returns count of nodes in loop.… Read More

Start Your Coding Journey Now!