Your are given two Nodes which correspond to the first elements of two linked lists which are merging at some point as show on the picture below.
&nbs ...
Search results for linked list
Insert and Remove operations on single linked list based on the Node value
Posted by CommonInterview
“Write functions Insert and Remove which add and remove nodes from ordered single linked list based on the Node value”
Operations of insertion ...
There are number of ways to solve this problem and it is really good opportunity to showcase your problem solving skills and knowledge of common data ...
“Write a function which will print values from the single linked list in the reverse order in O(n) time. No changes to the list can be made and no a ...
Answer
The idea is to choose sorting algorithm, as usually QuickSort and then think about swaping strategy.
Consider following situation:
1. The no ...
Reverse linked list
Posted by aleksin
Here is simple C# solution:
public Node Reverse(Node head)
{
Node next;
Node current;
current = head;
Node Resul ...
Find a loop in linked list
Posted by Sergei
Given single linked list find if it has a circle.
Make a seprate copy of a linked list that has an extra pointer than the regular ones. This pointer points to any random node in the list.
i.e.::node ...
« previous12 next »
