I was once asked a question, given a series of units and their ratios, such as inch, cm, gram vs pound, and a lot of potentially cryptic units and ratios, such as A, B, C, D, ... if I am given
n times to do the
add() to the table, and
m time to do
lookup() to get the conversion, such as from "mile" to "inch" and to "cm" and to "meter" if that was the originally given ratio pairs, then what is the time complexity? (Big O). (I think this is the question -- can't remember every single detail. Probably not temperature F conversion to C, because 0°F is not 0°C, while all other conversions are like 0 inch = 0 cm, meaning they can be converted by multiplying by a
Does this problem actually belong to Union-Find, and therefore can be solved by Weighted Quick Union as described by Sedgewick? Or does it belong to any other areas in CS?