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

推荐订阅源

Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
量子位
G
Google Developers Blog
J
Java Code Geeks
N
Netflix TechBlog - Medium
博客园 - 聂微东
宝玉的分享
宝玉的分享
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
月光博客
月光博客
The Cloudflare Blog
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
雷峰网
雷峰网
M
MIT News - Artificial intelligence
T
Tailwind CSS Blog
V
Visual Studio Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
Martin Fowler
Martin Fowler
有赞技术团队
有赞技术团队
T
The Blog of Author Tim Ferriss

博客园 - 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 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
print all Permutation of a string
HonestMan · 2007-09-21 · via 博客园 - HonestMan

void permutation(char *Pbegin, char *Pend)
{
    if(!Pbegin || !Pend)
    return;
    ///////////////////////
    //if Pbegin equal to Pend
    //this round is finished
    //print 
    if(*Pend)
    {
        printf("%s",Pbegin);
    }
    ///////////////////////
    else
    {
        for(char *c=Pend; *c; c++)
        {
            // swap c and Pend
            swap(c,Pend);
            Pertumation(Pbegin, Pend+1);
            swap(c,Pend);    
        }
    }
}

posted @ 2007-09-21 22:46  HonestMan  阅读(228)  评论(0)    收藏  举报