資源簡介
// 調用方法如下:
//
// 1.GetPermutation(T[], startIndex, endIndex)
// 對startIndex到endIndex進行排列,其余元素不變
//
// 2.GetPermutation(T[])
// 返回數組所有元素的全排列
//
// 3.GetPermutation(T[], n)
// 返回數組中n個元素的排列
//
// 4.GetCombination(T[], n)
// 返回數組中n個元素的組合
代碼片段和文件信息
//-----------------------------------------------------------------------------
//
//?算法:排列組合類
//
//?版權所有(C)?Snowdust
//?個人博客????http://blog.csdn.net/snowdust?&?http://snowdust.cnblogs.com
//?MSN?&?Email?snowdust77@sina.com
//
//?此源代碼可免費用于各類軟件(含商業軟件)
//?允許對此代碼的進一步修改與開發
//?但必須完整保留此版權信息
//
//?調用方法如下:
//
//?1.GetPermutation(T[]?startIndex?endIndex)
//?對startIndex到endIndex進行排列,其余元素不變
//
//?2.GetPermutation(T[])
//?返回數組所有元素的全排列
//
//?3.GetPermutation(T[]?n)
//?返回數組中n個元素的排列
//
//?4.GetCombination(T[]?n)
//?返回數組中n個元素的組合
//
//?版本歷史:
//?V0.1?2010-01-20?摘要:首次創建?
//
//-----------------------------------------------------------------------------
using?System;
using?System.Collections.Generic;
namespace?Arithmetic
{
public?class?PermutationAndCombination
{
#region?內部方法
///?
///?遞歸算法求數組的組合(私有成員)
///?
///?返回的范型
///?所求數組
///?輔助變量
///?
- 上一篇:C# 雙色球
- 下一篇:C# 排列組合(類庫很強大)
評論
共有 條評論