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

推荐订阅源

Y
Y Combinator Blog
GbyAI
GbyAI
爱范儿
爱范儿
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Check Point Blog
M
MIT News - Artificial intelligence
量子位
宝玉的分享
宝玉的分享
MongoDB | Blog
MongoDB | Blog
V
Visual Studio Blog
罗磊的独立博客
F
Fortinet All Blogs
美团技术团队
博客园_首页
博客园 - 【当耐特】
L
LangChain Blog
月光博客
月光博客
腾讯CDC
The Cloudflare Blog
D
Docker
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

博客园 - 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.