View Feed
group-icon
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12893 Members
Join this group to post and comment.

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.

Share this content on your social channels -