Banashree Patra
Banashree Patra
Branch Unspecified
24 Apr 2012

Algorithm to find the mth element from the end of list

Given a singly-linked list, devise a time and space efficient algorithm to find the mth
element from the end of the list.
If m = 0, then your algorithm should return the last element of the list. It should also
take care of boundary conditions. Analyze the time complexity of your algorithm.

Be the first one to reply

Share this content on your social channels -

Only logged in users can reply.