Why output contains 0
Because random pointer of that node is NULL;
you should make sure that your LL node’s random pointer should point to NULL if the corresponding node of input LL is pointing to NULL.
Because random pointer of that node is NULL;
you should make sure that your LL node’s random pointer should point to NULL if the corresponding node of input LL is pointing to NULL.