Computing the union of many LongLists was inefficient, because we were using a trivial algorithm. I replaced the algorithm with a multi way merge. The old algorithm had a runtime of O(n!*m) where n is the number of lists and m the length or the longest list. The new algorithm has a runtime of O(log(n) * n*m).
3.9 KiB
3.9 KiB