---
# System prepended metadata

title: reverse linked list

---

# reverse linked list



需要三個pointer 去maintain 三個值 
分別為 
1. 下一個
2. 當前
3. 前一個


```python=
temp = head->next;
head->next = prev;
prev = head;
head = temp;

```