Find the kth node in the linked list


This is my code for the kth node but i am not able to make the output even after getting the algo …can u correct my code please

hey @akshat42bajpai, you are calling merge list function in main

it still isn’t working

hi @akshat42bajpai, can you please share the updated code


wanted to know have i written the function code correctly?? of kth node

hi @akshat42bajpai,

  1. insert at tail
  2. move fast till k!=1 not k !=0
    else code is correct

i am not getting what you are saying… insert at tail i mean which line of code you are talking about??

@akshat42bajpai, u r inserting at head but in question it should be insert at tail


this is what i have done

@akshat42bajpai,
updated code https://ide.codingblocks.com/s/664137

but it’s not printing the whole linked list??

@akshat42bajpai it should print the kth bode only please go through question once

kth node from the end right??

and what if i need to print the whole linked list??

Han kth bode from end

just one more thing how can i print the whole linked list??

@akshat42bajpai y u want to print the whole linked list like I’m not getting for this question…

i mean after deleting the particular kth node now i want to print the remaining linked list

Here you dont need to delete any node right? It’s just asking for print the kth node from end

no no that i got it what question was asking…the other thing i want to try for my own knowledge…like if i want to print the linked list after deleting the particular node then how can i print it??