code: https://ide.codingblocks.com/s/219244
It does not print the last k value in front.
What is wrong in this?
code: https://ide.codingblocks.com/s/219244
It does not print the last k value in front.
What is wrong in this?
@princeky4 hi apka attach krne wala logic to sahi hai ,bs instead of these lines:
while(count1 < (num-1)){
current = current->next;
/* if(count2 < (num-2)){
previous = previous->next;
count2++;
} */
count1++;
}
while(count2 < (num-2)){
previous = previous->next;
count2++;
}
is logic ko hta ke ye krlo ki agr k>length of linked list to k=k% lenght of ll and just attach the k nodes as you have done,apka ans aajayega.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.