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

推荐订阅源

美团技术团队
T
The Blog of Author Tim Ferriss
C
Check Point Blog
博客园_首页
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
L
LangChain Blog
小众软件
小众软件
Stack Overflow Blog
Stack Overflow Blog
爱范儿
爱范儿
Vercel News
Vercel News
博客园 - Franky
V
V2EX
IT之家
IT之家
U
Unit 42
N
Netflix TechBlog - Medium
腾讯CDC
Apple Machine Learning Research
Apple Machine Learning Research
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
博客园 - 叶小钗
H
Help Net Security
V
Visual Studio Blog
GbyAI
GbyAI

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