更新图片链接

This commit is contained in:
kama
2025-05-19 17:11:04 +08:00
parent b489cb69b5
commit ce6e658d14
315 changed files with 2499 additions and 1729 deletions

12
problems/面试题02.07.链表相交.md Normal file → Executable file
View File

@@ -13,7 +13,7 @@
图示两个链表在节点 c1 开始相交:
![](https://file.kamacoder.com/pics/20211219221657.png)
![](https://file1.kamacoder.com/i/algo/20211219221657.png)
题目数据 保证 整个链式结构中不存在环。
@@ -21,15 +21,15 @@
示例 1
![](https://file.kamacoder.com/pics/20211219221723.png)
![](https://file1.kamacoder.com/i/algo/20211219221723.png)
示例 2
![](https://file.kamacoder.com/pics/20211219221749.png)
![](https://file1.kamacoder.com/i/algo/20211219221749.png)
示例 3
![](https://file.kamacoder.com/pics/20211219221812.png)
![](https://file1.kamacoder.com/i/algo/20211219221812.png)
@@ -42,11 +42,11 @@
看如下两个链表目前curA指向链表A的头结点curB指向链表B的头结点
![面试题02.07.链表相交_1](https://code-thinking.cdn.bcebos.com/pics/面试题02.07.链表相交_1.png)
![面试题02.07.链表相交_1](https://file1.kamacoder.com/i/algo/面试题02.07.链表相交_1.png)
我们求出两个链表的长度并求出两个链表长度的差值然后让curA移动到和curB 末尾对齐的位置,如图:
![面试题02.07.链表相交_2](https://code-thinking.cdn.bcebos.com/pics/面试题02.07.链表相交_2.png)
![面试题02.07.链表相交_2](https://file1.kamacoder.com/i/algo/面试题02.07.链表相交_2.png)
此时我们就可以比较curA和curB是否相同如果不相同同时向后移动curA和curB如果遇到curA == curB则找到交点。