
-----------------------------------
a22asin
Mon Mar 31, 2014 11:12 am

Randomnizing a LinkedList
-----------------------------------
Hi, so im working on an assignment where i have 3 classes, card, cardDeck and tester. What i need to do is convert the cardDeck classes to use LinkedList instead of an array. The problem im having is trying to figure out how to shuffle the deck using the linkedList.

This is what im given:
 [code]
   public void shuffle()
   {
      // randomly choose position among 0 to 51  to swap with position 0
      // randomly choose position among 1 to 51  to swap with position 1
      // ...
      // randomly choose position among k to 51  to swap with position k
      // ...
      // randomly choose position among 50 to 51 to swap with position 50
      
      Random rand = new Random();
      initialize();
      for (int k = 0; k 