Sitemap
Nov 15, 2023

O(N) being the worst-case, because you can bin-search the location of the customer ID in O(logN) and use it as a starting point for the iteration. If a single customer is responsible for all the page visits in a day (edge case and would probably indicate a problem in collecting the data), then the algorithm would revert back to an O(N) runtime.

Mihai Bojin
Mihai Bojin

Written by Mihai Bojin

Software Engineer at heart, Manager by day, Indie Hacker at night. Writing about DevOps, Software engineering, and Cloud computing. Opinions my own.

Responses (1)