Hello,
I have a linked list that holds data about people (name, age, gender, race, etc) and I need to be able to get two random elements(one male, one female) from the list. I really have no clue how I would do this because as far as I am aware you can't access a list by a certain element number like you can array. I'd have to traverse through it but that still doesn't help with pulling 2 random elements from it. I'm thinking maybe set a variable to count the number of male/female elements then traverse through the list a random number less than the variable? I'm honestly really confused on how I can do this. Thank you in advance.