Categorygithub.com/szhou12/leetcode-goleetcode0116-Populating-Next-Right-Pointers-in-Each-Node
package
0.0.0-20241220224003-b7cf03a90b2b
Repository: https://github.com/szhou12/leetcode-go.git
Documentation: pkg.go.dev

# README

116. Populating Next Right Pointers in Each Node

Solution idea

BFS

层序遍历的简单应用,每一层最后一个元素区别处理一下.

Time complexity = $O(n)$ where $n$ total number of nodes