# 算法-寻找两个链表的第一个公共结点

```struct ListNode
{
int value;
ListNode *next;
};```

```ListNode* FindFirstCommonNode( ListNode *pHead1, ListNode *pHead2)
{

int nLengthDif = nLength1 - nLength2;

if(nLength2 > nLength1)
{
nLengthDif = nLength2 - nLength1;
}

for(int i = 0; i < nLengthDif; ++ i)

{
}

return pFisrtCommonNode;
}

{
unsigned int nLength = 0;
while(pNode != NULL)
{
++ nLength;
pNode = pNode->next;
}

return nLength;
}```

96 篇文章36 人订阅

0 条评论

## 相关文章

4165

2710

2608

### Effective Testing with RSpec 3 （英文版）(序言)

Early praise for Effective Testing with RSpec 3

1844

### java.base.jmod

/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/jmods\$ jmod list java....

1172

### Save Camera Document

#pragma once #include "HCCamera.h" #include <time.h> #include <cstdio> #incl...

2908

### 高通msm8909耳机调试

1、DTS相应修改： DTS相关代码：kernel/arch/arm/boot/dts/qcom/msm8909-qrd-skuc.dtsi： 1 s...

8025

### echarts太阳分布图-饼图来回穿梭

var dom = document.getElementById("container");

1392

### 2018年SCI期刊最新影响因子排行，最高244，人工智能TPAMI9.455

2018年6月26日，最新的SCI影响因子正式发布，涵盖1万2千篇期刊。CA-Cancer J Clin 依然拔得头筹，其影响因子今年再创新高，达244.585...

1472

### Spark Streaming Dynamic Resource Allocation

DRA has already been implemented since Spark 1.2 . However the existing Spark DR...

1473