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

Commitcda1ae3

Browse files
refactor 116
1 parentebb4e68 commitcda1ae3

File tree

1 file changed

+2
-1
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+2
-1
lines changed

‎src/main/java/com/fishercoder/solutions/_116.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static class Solution1 {
2020
* credit: https://discuss.leetcode.com/topic/1106/o-1-space-o-n-complexity-iterative-solution
2121
* based on level order traversal
2222
*/
23-
publicvoidconnect(Noderoot) {
23+
publicNodeconnect(Noderoot) {
2424

2525
Nodehead =null;//head of the next level
2626
Nodeprev =null;//the leading node on the next level
@@ -54,6 +54,7 @@ public void connect(Node root) {
5454
head =null;
5555
prev =null;
5656
}
57+
returnroot;
5758
}
5859
}
5960

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp