Difference between O(logn) and O(nlogn)
Think of it as O(n*log(n)), i.e. “doing log(n) work n times”. For example, searching for an element in a sorted list of length n is O(log(n)). Searching for the element in n different sorted lists, each of length n is O(n*log(n)). Remember that O(n) is defined relative to some real quantity n. This might be … Read more