Wednesday, July 9, 2008

Obtain the pointer to Nth last node in a single linked list.

Technique: Suppose you are given 2 buses Bus-A and Bus-B travelling always at 100mph and you have to maintain a distance of 20mps between them. Then you will achieve this by staring Bus-A first from the source station. You start Bus-B only when Bus-A is 20 miles from source station.

No comments: