diff --git a/problems/0206.翻转链表.md b/problems/0206.翻转链表.md index 941928ba..2e80972c 100644 --- a/problems/0206.翻转链表.md +++ b/problems/0206.翻转链表.md @@ -497,5 +497,20 @@ struct ListNode* reverseList(struct ListNode* head){ } ``` +PHP: +```php +// 双指针法: +function reverseList($head) { + $cur = $head; + $pre = NULL; + while($cur){ + $temp = $cur->next; + $cur->next = $pre; + $pre = $cur; + $cur = $temp; + } + return $pre; +} +``` -----------------------