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

推荐订阅源

Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
Google Developers Blog
S
SegmentFault 最新的问题
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
P
Proofpoint News Feed
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
L
LangChain Blog
F
Fortinet All Blogs
C
Check Point Blog
博客园_首页
I
InfoQ
Jina AI
Jina AI
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
Engineering at Meta
Engineering at Meta
美团技术团队
Vercel News
Vercel News
Apple Machine Learning Research
Apple Machine Learning Research

博客园 - 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)    收藏  举报