algorithmic complexity using the big-O notation