This isn't exactly specific to Java, but more asking for advice on the logic of a sort I'm trying to implement.
I have a list of objects that have been compared to each other. There are "Winners" and "Losers".
So my list might be something like:
A beats B
B beats C
B beats D
D beats C
E beats A
And I want to sort them, so the "best" are at the top, so in that example the list would be sorted to:
E, A, B, D, C
I'm unsure how to tackle this logically. I've been thinking about every time I encounter a new element, looking up all the "rules" it's a part of, and then adding it to my "sorted" array based on those rules and the elements that are already in there.
I can't help feel there must be a better way and even with the above method I'm not sure how I would program it. Any advice would be awesome. Cheers.

