Tag Archives: linked lists

Cyclic Linked List – finding the start of the loop using Python

I’d blogged previously about writing a python function to find out whether a linked list is cyclic or acyclic – it’s worth a read before tackling this one. The challenge here is to return the node that is at the … Continue reading

Posted in programming | Tagged , , , | Leave a comment

Mth to last – a recursive approach in Python

A collegue of mine was pondering the mthToLast problem for a LinkedList I’d blogged about previously and sent me the following IM message: just a guess – but can you use recursion to solve your link list m problem? a … Continue reading

Posted in programming | Tagged , , , | Leave a comment

More on Linked Lists – flattening and unflattening

More from the Programming Interviews Exposed book (see last post). In this problem you take a double linked list (where each node knows its previous and next nodes) with child elements, and flatten it. Then unflatten it back to its … Continue reading

Posted in programming | Tagged , , , | Leave a comment