Hoarding programming problems for you!

Looking for good programming challenges?

Use the search below to find our solutions for selected questions!

All posts tagged list

Given a linked list, determine if it has a cycle in it

Problem statement Given a linked list, determine if it has a cycle in it. Solution For the solution we are going to use a technique known as the two-pointer technique. That is we will involve two pointers: one slow-runner and the other fast-runner. The slow-runner will move forward 1 list . . . Read more

Merge k sorted linked lists and return it as one sorted list

Problem statement Merge k sorted linked lists and return it as one sorted list. Solution We reduce the problem to the merging of two linked lists problem. This can be done in time and space. So we first write out the function to merge two sorted lists:

We can . . . Read more