This implementation is based on the paper by T.D. Nguyen, B. Schmidt, and C.K. Kwoh "SparseHC: a memory-efficient online hierarchical clustering algorithm" and its C++ implementation found here.
According to the paper, the empirical runtime complexity for complete-linkage is O(n2) and the empirical memory complexity is O(n). Thus, this algorithm can be suitable for hierarchical clustering of a large number of objects when the memory is scarce.
The source code is available on GitHub.