Grokking the Coding Interview: Patterns for Coding Questions
Vote

0% completed

​

Problem Challenge 1: Connect All Level Order Siblings (medium)

.....

.....

.....

Like the course? Get enrolled and start learning!
A

Anonymous

· 4 years ago

I don't believe you need a previous. Just set currentNode.next to the head of the Queue. On the very last iteration/node the queue will be empty so currentNode.next = null.

Image

Reading Progress

0%


Vote for new content