# 前向星

0: 1 2
1: 1 3
2: 1 5
3: 2 3
4: 3 4
5: 4 1
6: 4 5

head[1] = 0, len[1] = 3
head[2] = 3, len[2] = 1
head[3] = 4, len[3] = 1
head[4] = 5, len[4] = 2
head[5] = -1, len[5] = 0

# 链式前向星

e[0]: v = 2, next = 1 head[1] = 0
e[1]: v = 3, next = 2
e[2]: v = 5, next = -1
e[3]: v = 3, next = -1 head[2] = 3
e[4]: v = 4, next = -1 head[3] = 4
e[5]: v = 1, next = 6 head[4] = 5
e[6]: v = 5, next = -1