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

推荐订阅源

Jina AI
Jina AI
Recent Announcements
Recent Announcements
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
A
About on SuperTechFans
Vercel News
Vercel News
博客园 - 【当耐特】
爱范儿
爱范儿
Blog — PlanetScale
Blog — PlanetScale
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
D
Docker
博客园 - 叶小钗
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
H
Help Net Security
I
InfoQ
博客园 - 三生石上(FineUI控件)
博客园 - Franky
Microsoft Azure Blog
Microsoft Azure Blog
The GitHub Blog
The GitHub Blog
大猫的无限游戏
大猫的无限游戏
MongoDB | Blog
MongoDB | Blog
奇客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 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)    收藏  举报