Skip to content

001 号第一周作业: LeetCode24-Swap Nodes in Pairs #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 16, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
week01:leetcode24-Swap Nodes in Pairs
  • Loading branch information
zouyingjie committed Apr 15, 2019
commit b4a7ba16b4079bd1cb39ed7b5c83c6d10540ad3f
3 changes: 0 additions & 3 deletions Week_01/id_1/LeetCode24.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class Solution {

public ListNode swapPairs(ListNode head) {


if (head == null) {
return null;
}
Expand All @@ -18,7 +17,6 @@ public ListNode swapPairs(ListNode head) {

ListNode node = head;
ListNode next = head.next;

while (node != null && next != null) {

node = swap(node, next);
Expand All @@ -27,7 +25,6 @@ public ListNode swapPairs(ListNode head) {
break;
}
next = node.next;

}
return result;

Expand Down