These are chat archives for kennyledet/Algorithm-Implementations

27th
Apr 2016
CJJ
@ysharplanguage
Apr 27 2016 18:20
@jsanchez034: the map you populate in the first two nested loops is essentially a dictionary (i.e., a hash of key / value pairs) where the keys are c^3 + d^3 (with an integer co-domain) and the values are list of (c, d) tuples. Because those keys are just integers, it's safe to assume that the map can compute a hash code for those keys in constant time, O(1) (hence, why the "result, key" lookup performed by that outermost "for each result, list in ..." loop preserves the overall O(n^2) complexity of that "for each pair1 ... for each pair2 ... etc"