Thread: Randomizing the positions of the elements of an array of structures

  1. #1
    Registered User
    Join Date
    Oct 2012
    Posts
    14

    Randomizing the positions of the elements of an array of structures

    Okay maybe I am being too specific I would like to know if there is any easy way randomize the position of elements in an array. I am studying for a exam which is on the 8th nextmonth. I asked the lecturer same question he answered but his method is too long. The paper is supposed to be handwritten and there is going to be limited space. So shorter methods welcome.
    Last edited by Burns111; 11-27-2012 at 02:05 PM.

  2. #2
    SAMARAS std10093's Avatar
    Join Date
    Jan 2011
    Location
    Nice, France
    Posts
    2,694
    Would you like to tell us why you are posting or we should find out ourselves?

  3. #3
    Registered User
    Join Date
    May 2012
    Posts
    1,066
    Quote Originally Posted by Burns111 View Post
    I would like to know if there is any easy way randomize the position of elements in an array.
    Fisher-Yates shuffle

    Bye, Andreas

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Randomizing Array
    By djay86753 in forum C Programming
    Replies: 3
    Last Post: 04-17-2012, 01:28 AM
  2. finding positions of characters in a 2d array
    By synhyborex in forum C Programming
    Replies: 2
    Last Post: 02-13-2011, 03:37 PM
  3. Replies: 12
    Last Post: 03-11-2010, 02:28 PM
  4. Replies: 7
    Last Post: 02-25-2010, 11:38 AM
  5. counting array positions
    By Cpro in forum C++ Programming
    Replies: 4
    Last Post: 02-04-2008, 11:25 PM