I've seen a lot of different possible ways to do so, but I was wondering what people thought the most efficient way was.
adaykin
0
Junior Poster in Training
Recommended Answers
Jump to PostWhat do you mean? A queue means its FIFO - first item put in the queue is the first item that comes out of the queue. So its not random.
Jump to PostMy point is that its not a queue, then. Just take an ArrayList, use int index = Math.Random(n) where n is the # of items in your ArrayList, then index is the random index you want.
All 6 Replies
BestJewSinceJC
700
Posting Maven
adaykin
0
Junior Poster in Training
BestJewSinceJC
700
Posting Maven
adaykin
0
Junior Poster in Training
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
adaykin
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.