the solution for the problem of populationg next right pointers in each node