#single-pass-algorithm