C#数组随机排序
来源:互联网 发布:sql去重复行 编辑:程序博客网 时间:2024/05/17 06:31
public static T[] RandomSort<T>(T[] array)
{
int len = array.Length;
Random rand = new Random();
System.Collections.Generic.List<int> list = new System.Collections.Generic.List<int>();
T[] ret = new T[len];
int i = 0;
while (list.Count < len)
{
int iter = rand.Next(0, len);
if (!list.Contains(iter))
{
list.Add(iter);
ret[i] = array[iter];
i++;
}
}
return ret;
}
- C#数组随机排序
- C# 随机产生一定长度数组并对其排序
- asp数组随机排序
- 数组随机排序
- asp数组随机排序
- php数组随机排序
- asp数组随机排序
- asp数组随机排序
- asp数组随机排序
- AS3数组随机排序
- 数组元素随机排序
- 给定数组随机排序
- 随机排序数组
- 数组随机排序
- JS 数组随机排序
- 给数组随机排序
- javascript 数组随机排序
- js数组随机排序
- 聚合策略中选择OLAP还是聚合表
- 基于决策表的测试
- 关于“Monitor.jse”
- flex URLRequest 路径问题
- V$session表的妙用
- C#数组随机排序
- 遍历DataGrid的Cell中的控件,寻找ButtonColumn类型列的LinkButton对象
- symbian 内存释放注意
- C#轻量级XML数据载入器
- linux下的串口通信程序详解
- php socket Tcp连接例子
- Linux内核
- 统计数据库日志大小并定时email 发送到管理员邮箱
- C专家编程学习笔记(2)