LeetCode – Populating Next Right Pointers in Each Node (Java)
Given the following perfect binary tree, 1 / \ 2 3 / \ / \ 4 5 6 7 After calling your function, the tree should look like: 1 -> NULL / \ 2 -> 3 -> NULL / \ / \ 4->5->6->7 -> NULL Java Solution 1 – Simple public void connect(TreeLinkNode root) { … Read more