5197063ae3fed200fe8418b6785d0a406b2b819b
The reason seems to be the number of memory allocations. In order to create the union of 100 lists we have 99 memory allocations. The first needs the space for the first two lists, the second the space for the first three lists, and so on. We can reduce the number of allocations drastically (in many cases to one) by leveraging the fact that many of the lists were already sorted, non-overlapping and increasing, so that we can simply concatenate them.
Description
No description provided
Languages
Java
79.4%
TypeScript
11.1%
HTML
4.5%
Python
2.8%
SCSS
1.1%
Other
0.9%