Unlike in-Algorithm 2 Sparse matrix multiplication using the CSR format.
furthermore, because for each k, we compare C[k] with every element of D, it must be the case that after looping over all n (line 4), we have C[k] ≤ D[n] for all n. when the algorithm finishes, D contains the top-N values.