Print nodes at kth distance


please help with the code

Hello @jha.aparna17 what is the problem that you are facing?

see this code;


if you have any doubt you can ask here:
Happy Learning!!

source.cpp: In function ‘node* search(node*, int)’: source.cpp:83:1: warning: control reaches end of non-void function [-Wreturn-type] 83 | } | ^ Thats the eproblem

@jha.aparna17 the code which i have given to you is correcet and there is no error in that.
please check that it is according to your logic only.

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.