Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit27ae4ce

Browse files
committed
moidfy solutions
1 parent6ca6233 commit27ae4ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎树/117. 填充每个节点的下一个右侧节点指针 II.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,5 @@ class Solution:
7272
return root
7373
```
7474

75-
117 和116的差异在于常数空间占用,因为next指针本身提供了横向遍历的可能,所以用3个指针分别指向当前,上一个节点,以及下一行的初始节点
75+
1. 117 和116的差异在于常数空间占用,因为next指针本身提供了横向遍历的可能,所以用3个指针分别指向当前,上一个节点,以及下一行的初始节点
76+
2. 双层循环,外层是下一行,内层是每行遍历。pre指针是next的前节点,head是下一层的头节点。每一步cur向右移动,pre也向右移动

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp