.NET 2005 Parallel ArrayLists - Sorting
Posted on 2007-04-01
I have two ArrayLists in a .NET 2005 class. One stores a list of candidates. The other, the number of votes that they have. I'm trying to now write a function that will return a formatted result for the number of votes each candidate has. Obviously I could leave them in the order in which they were input (which I suppose would work okay), but it seems logical to want to put the winner at the top with the number of votes they received and a percentage. How can I sort both lists so that each entry winds up staying in the same position as the corresponding number of votes?