Tag Info

New answers tagged

-1

I found the answer here. Python actually has this functionality built in. For example 'A' < 'F' # Returns true because A comes before F Thus one can use the function def is_in_range(range, letter): return range[:2] <= letter <=range[3:5] is_in_range('SA-SF','SM') False is_in_range('SG-SM','SM') True Note: Case will screw this up so ...


3

First, your definition of your numbers can lead to non-fractions (e.g., p=2, q=0). Second, to summarize your idea: Store all your fractions as integers Perform an integer sort Convert all your integers back to fractions Seems like a lot of unnecessary memory and time when a lot of sorting algorithms can be done using a simple comparison sort and you can ...


1

Rating the relative strengths of teams/contestants is sort of a solved problem, so why re-invent the wheel? There is the Elo rating system, originally devised for chess, and there is also the Glicko (pdf) rating system. Both systems try to model the probability that one contestant will win against another, and produce a score representing their relative ...



Top 50 recent answers are included