Skip to content

Commit

Permalink
求中间结点
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryanlby committed Aug 8, 2019
1 parent 31b0908 commit e1347e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions java/06_linkedlist/SinglyLinkedList.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ public int getData() {
return data;
}
}

public static void main(String[]args){

SinglyLinkedList link = new SinglyLinkedList();
Expand Down
2 changes: 1 addition & 1 deletion java/07_linkedlist/LinkedListAlgo.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public static Node findMiddleNode(Node list) {
Node fast = list;
Node slow = list;

while (fast.next != null && fast.next.next != null) {
while (fast != null && fast.next != null) {
fast = fast.next.next;
slow = slow.next;
}
Expand Down

0 comments on commit e1347e4

Please sign in to comment.