Linked List Kth Node from Last

Can we do it by first finding the tail then traversing back till k times ??

hi @ashwani225 how do you plan to go back in a singly linked list? there is no way to do so.

By finding reverse then traversing to kth node??

@ashwani225 yes you can do that

which method will cost less time complexity??

@ashwani225 I think the time complexity will be the same for both cases but the method given in video is more efficient because less steps are involved. You can try coding both of them for practicea and use the one you are more comfortable with.

https://ide.codingblocks.com/s/247404 Is this correct for Kth node??

@ashwani225 the code seems to be working for multiple inputs, if you want to be absolutely sure you can try submitting it in a challenge or derive a mathematical proof.