自己实现全排列:I found some old code were good:We should think in a reverse way
来源:互联网 发布:高性能linux 编辑:程序博客网 时间:2024/05/22 03:35
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace zuhe
{
class Program
{
static public void zuhe(char[] c, StringBuilder s, int level)
{
for (int i = level; i < c.Length; i++)
{
s.Append(c[i]);
Console.WriteLine(s);
if (level < c.Length - 1)
{
level++;
zuhe(c, s,level);
}
s.Length -= 1; //setting lower length to differ the new stringbuider from the old
}
}
static void Main(string[] args)
{
string me = "abcd";
char[] my = me.ToCharArray();
StringBuilder sb = new StringBuilder();
zuhe(my, sb, 0);
Console.ReadKey();
}
}
}
- 自己实现全排列:I found some old code were good:We should think in a reverse way
- we should think more
- A Static Method Should Be Accessed In A Static Way
- What should we do when meet a crash in android?
- What should we do when meet a crash in android
- Traditional Saliency Reloaded: A Good Old Model in New Shape
- We should: Good Good Study, Day Day Up
- Think in another way【Matrix67】
- Some sites I found ...
- 10494 If We Were a Child Again
- uva10494 - If We Were a Child Again
- 10494 - If We Were a Child Again
- 5312 If We Were a Child Again
- 10494 - If We Were a Child Again
- If We Were a Child Again
- If We Were a Child Again
- 10494 - If We Were a Child Again
- uva10494 if we were a child again
- extjs之-读取xml
- 两个Linux操作系统NFS服务器的配置方法
- (转)[译]Google C++编程风格指南(二)
- 关于近期闹的满城风雨的高考作弊问题的一些联想(转)
- 前台线程与后台线程
- 自己实现全排列:I found some old code were good:We should think in a reverse way
- 网吧服务器从“黑”到“白”的艰难过程(2)
- 计算机考研专业课大纲 09
- Porting Android to our BB board
- 必须坚决反击“谷歌搜索购物”
- iPhone开发四剑客之《iPhone开发秘籍》
- XAMPP 是一个易于安装且包含 MySQL、PHP 和 Perl 的 Apache 发行版
- Spring.net Could not load type from string value
- Symbian 中的sdp服务