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

推荐订阅源

博客园 - Franky
有赞技术团队
有赞技术团队
宝玉的分享
宝玉的分享
雷峰网
雷峰网
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
大猫的无限游戏
大猫的无限游戏
博客园 - 司徒正美
D
Docker
T
The Blog of Author Tim Ferriss
罗磊的独立博客
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
J
Java Code Geeks
Jina AI
Jina AI
博客园 - 【当耐特】
C
Check Point Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
腾讯CDC
Last Week in AI
Last Week in AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog

博客园 - HonestMan

面试百问 o,1的感悟 公司内部推荐 debain oracle insert method a linked list, find the node that the last node point to. 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 wirte a function for counting a linked list length Remove repeat char from a string
spilt a list
HonestMan · 2007-09-18 · via 博客园 - HonestMan

spilt a list and become two sublists
void spilt(struct node *source, struct node** front, struct code** back){
    int len = count(source);
    int i;
    struct node* current =source;
    if(len<2)
    {
        *front = source;
        *back = null;
    }
    else
    {
        int partion=(len-1)/2;
        for(int i=0; i<partion; i++)
        {
            current=current->next;
        }
        //cut
        *front = source;
        *back=current->next;
        current->next = null;
    }
}

a little funtion is very useful in common. if you have more smarter code, please post it.