放大数字列表 [英] radomize a number list

查看:115
本文介绍了放大数字列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

int [] list = {1,2,3,4,5,6};


随机化列表的功能?

干杯!


-

William Stacey,MVP

int[] list = {1,2,3,4,5,6};

Function to randomize the list?
Cheers!

--
William Stacey, MVP

推荐答案

更具体的例子/需要。取任何长度为> = 2的ArrayList。现在

以最有效的方法随机化元素。 TIA


-

William Stacey,MVP


" William Stacey [MVP]" < ST *********** @ mvps.org>在消息中写道

news:eQ ************** @ TK2MSFTNGP12.phx.gbl ...
More specific example/need. Take any ArrayList of length >=2. Now
randomize the elements in most efficient method. TIA

--
William Stacey, MVP

"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:eQ**************@TK2MSFTNGP12.phx.gbl...
int [] list = {1,2,3,4,5,6};

将名单随机化的功能?
干杯!

-
William Stacey ,MVP
int[] list = {1,2,3,4,5,6};

Function to randomize the list?
Cheers!

--
William Stacey, MVP






运行ArrayList.Sort方法,传入一个自定义比较器,返回-1

或1随机。




" William Stacey [MVP]" < ST *********** @ mvps.org>在消息中写道

news:uH ************** @ tk2msftngp13.phx.gbl ...
Run the ArrayList.Sort method, passing in a custom comparer that returns -1
or 1 randomly.
?

"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:uH**************@tk2msftngp13.phx.gbl...
更具体的例子/需要。取任何长度为> = 2的ArrayList。现在,用最有效的方法随机化元素。 TIA

- William Stacey,MVP

William Stacey [MVP]" < ST *********** @ mvps.org>在消息中写道
新闻:eQ ************** @ TK2MSFTNGP12.phx.gbl ...
More specific example/need. Take any ArrayList of length >=2. Now
randomize the elements in most efficient method. TIA

--
William Stacey, MVP

"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:eQ**************@TK2MSFTNGP12.phx.gbl...
int [] list = {1,2 ,3,4,5,6};

随机化列表的功能?
干杯!

-
William Stacey,MVP
int[] list = {1,2,3,4,5,6};

Function to randomize the list?
Cheers!

--
William Stacey, MVP



试试这个: http://www.boyet.com/Articles/SimpleShuffling.html


Scott
Try this: http://www.boyet.com/Articles/SimpleShuffling.html.

Scott
更具体的例子/需要。取任何长度为> = 2的ArrayList。现在,用最有效的方法随机化元素。 TIA
More specific example/need. Take any ArrayList of length >=2. Now
randomize the elements in most efficient method. TIA



这篇关于放大数字列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆