Code not working ( kill process )

Please check the code, it’s not returning anything.
My code:

Hey,your code is giving segmentation fault as you are not considering that it is one-based indexing and not zero based.So,for example if a process has parent id as 3 and size of child array is 3 then there is no 3 index in your adjacency list.

1 Like

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.