RecPermute Code
来源:互联网 发布:阿里云 香港机房 被墙 编辑:程序博客网 时间:2024/06/01 10:04
来自:网易公开课《抽象编程》
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace PermuteCode{ class Program { static void Main(string[] args) { ListPermutation("ABCDE"); Console.ReadKey(); } static void ListPermutation(string s) { RecPermute("", s); } static void RecPermute(string soFar,string rest) { if (rest == "") { var display = soFar; Console.WriteLine(display); return; } for (int i = 0; i < rest.Length; i++) { string next = soFar + rest[i]; string remaining = rest.Substring(0, i) + rest.Substring(i + 1); RecPermute(next, remaining); } } }}
- RecPermute Code
- code
- code
- code
- code
- Code
- code
- code
- Code
- Code
- CODE
- code
- code
- code
- code
- code
- code
- Code
- 黑马程序员-封装
- memcached安装
- 第四次作业
- 读《松本行弘的程序世界》——松本行弘眼中Ruby受欢迎的原因
- 黑马程序员_java基础(语法)
- RecPermute Code
- HDU 4510-小Q系列故事——为什么时光不能倒流
- 在类和结构之间选择
- android中sqlite的使用(一)
- 基于音频指纹技术的微信“摇一摇搜歌”和QQ音乐“听歌识曲”
- <iOS>关于子线程和block中操作主线程界面的控件讨论
- C++类型转换
- jquery常用方法总结
- 少年派