K Append : Segmentation fault
hello @mverma_be19 if you are doing this way then you should do this way .
you are doing it in the reverse manner .
the thing which you should do before you were doing afterwards .
https://ide.codingblocks.com/s/325768.
i hope i have cleared your doubt .
Happy Learning !!
https://ide.codingblocks.com/s/325783 I have corrected my code acc to the error mentioned by you. Its still giving incorrect ouput. Its very similar to the corrected code you provided. Just the method for finding kth node differs. Please look into it
@mverma_be19 see this https://ide.codingblocks.com/s/325867
please mark this as resolved .
hit the like button .
Happy Learning !!
Okay thanks a lot. Just a last confusion if you could help me with it plz. How we will know that which operation should be performed first in the linked list. Like what I know is that the right most operation should be handled first acc to which I attempted the question and made the last element on the list point to head. But in the correct sol you provided we are performing the operations from left to right.
hello @mverma_be19 this you could learn by practicing more questions and before implementing please try to dry run for any small test cases .
and even then you are not able to pass the test cases then you can definitely take help from us .
i hope i have cleared your doubt .
Happy Learning !!
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.