algorithm - What's the quickest way to find all possible pairs in list? -
basically have list of players, , want pair them each player play once. what's quickest way find data?
assuming players not appear in list twice, double for
loop quick:
for (int i=0, <= playerlist.count - 2, i++) (int j=i+1, j <= playerlist.count - 1, j++) //add new pairing of player , j
Comments
Post a Comment