惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
I
InfoQ
H
Help Net Security
GbyAI
GbyAI
博客园 - 叶小钗
Recent Announcements
Recent Announcements
Engineering at Meta
Engineering at Meta
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
爱范儿
爱范儿
Y
Y Combinator Blog
L
LangChain Blog
腾讯CDC
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
F
Fortinet All Blogs
G
Google Developers Blog
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
博客园 - Franky
D
Docker
Jina AI
Jina AI
罗磊的独立博客

博客园 - HonestMan

面试百问 o,1的感悟 公司内部推荐 debain oracle insert method Get balance noe Memory - HonestMan - 博客园 ShuffleMerge---microsoft's interview question 新手开始学习linux print all Permutation of a string An funy question! Google, hire me How to interview a programmer? Binary search tree convert to double linked list. Search in Binary tree spilt a list wirte a function for counting a linked list length Remove repeat char from a string
a linked list, find the node that the last node point to.
HonestMan · 2007-09-25 · via 博客园 - HonestMan

                        _______  
                       |              |
               1-->2-->3-->4
2 is the node that we want.

struct node * FindNode(struct node **La)
{
    struct node *current=*La;
    struct node *last=*La;

    //point to last node;
    while(last->next>last)
    {
        last++;
    }
    //
    while(current<last)
    {
        if(current==last->next)
        return current;
        current ++;
    }
}