Code for problem "Populating Next Right Pointers in Each Node II".