prabhupant / python-ds

No non-sense and no BS repo for how data structure code should be in Python - simple and elegant.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swap Kth node from beginning with Kth node from end in a Linked List

nikhilanu opened this issue · comments

Given a singly linked list, swap kth node from beginning with kth node from end. Swapping of data is not allowed, only pointers should be changed. This requirement may be logical in many situations where the linked list data part is huge.

Has anyone implemented it ?