Linked List 用快慢指针找中点的3种写法的不同
- fast = head, while (fast.next != null && fast.next.next != null)
Node fast = head;
while (fast.next != null && fast.next.next != null) {
slow = slow.next;
fast = fast.next
Linked List 用快慢指针找中点的3种写法的不同
Node fast = head;
while (fast.next != null && fast.next.next != null) {
slow = slow.next;
fast = fast.next