查找链表相同节点

t_node * find_node(t_node *plink1, t_node *plink2)
{
int link1_length = link_length(plink1);
int link2_length = link_length(plink2);
t_node *link1 = plink1;
t_node *link2 = plink2;

if(link1_length < link2_length)
{
link1 = plink2;
link2 = plink1;
}

link1 = advance_steps(link1, abs(link1_length - link2_length));

return find_crossed_node(link1, link2);
}

你可能感兴趣的:(链表)