cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
stuck on assignment
stuck on assignment
Mar 9, 2010 at 2:46pm UTC
nicks
(1)
need to randomize an array an got stuck
Mar 9, 2010 at 2:53pm UTC
closed account (
STR9GNh0
)
randomize the size of the array or the contents?
Mar 9, 2010 at 9:57pm UTC
tummychow
(1210)
Try this. I used this a while back.
You randomly select two, different, elements of the array. Swap them.
Now put that code in a for loop and let it execute about a million times.
Works reasonably well.
Topic archived. No new replies allowed.