# 一个算法问题

0
[已解决问题] 解决于 2009-07-08 19:24

0

`        private static void Permutation(List<int> v, int m, int n)        {            int i;            if (m < n - 1)            {                Permutation(v, m + 1, n);                for (i = m + 1; i < n; i++)                {                    Swap(v, m, i);                    Permutation(v, m + 1, n);                    Swap(v, m, i);                }            }             else            {                foreach (int vs in v)                {                    Console.Write(vs);                }                Console.Write("\r\n");            }        }        private static void Swap(List<int> v, int m, int i)        {            int t;            t = v[m]; v[m] = v[i]; v[i] = t;        }调用方法：List<int> v = new List<int> { 1, 2, 3};Permutation(v, 0, 3);`

Cheese | 小虾三级 |园豆：509 | 2009-07-08 13:01

0

0

Exception | 园豆：205 (菜鸟二级) | 2009-07-07 17:59
0

http://www.diybl.com/course/4_webprogram/asp.net/asp_netshl/2008124/97113.html

Gray Zhang | 园豆：17610 (专家六级) | 2009-07-08 11:05

您需要登录以后才能回答，未注册用户请先注册