Asked by Varun Bhatia.
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 palindrome, else false. Recommended: Please solve it… Read More »
Given a linked list, check if the the linked list has loop or not. Below diagram shows a linked list with a loop.
Given pointer to the head node of a linked list, the task is to reverse the linked list. Examples: Input : Head of following linked… Read More »
A simple solution is to traverse the linked list until you find the node you want to delete. But this solution requires pointer to the… Read More »
Given a singly linked list and a key, count number of occurrences of given key in linked list. For example, if given linked list is… Read More »
Algorithm For C/C++: Iterate through the linked list and delete all the nodes one by one. Main point here is not to access next of… Read More »
Given a Linked List and a number n, write a function that returns the value at the n’th node from end of the Linked List.
Given a singly linked list, find middle of the linked list. For example, if given linked list is 1->2->3->4->5 then output should be 3. If… Read More »
Given a pointer to a node to be deleted, delete the node. Note that we don’t have pointer to head node. Recommended: Please solve it… 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 »