PART 1
Getting Started
Many possible functions can result in worse results, but the choice of functions
offered by the Big O notation that you can use is restricted because its purpose is
to simplify complexity measurement by proposing a standard. Consequently, this
section contains just the few functions that are part of the Big O notation. The fol-
lowing list describes them in growing order of complexity:
»
Constant complexity O(1): The same time, no matter how much input you
provide. In the end, it is a constant number of operations, no matter how long
the input data is. This level of complexity is quite rare in practice.
»
Logarithmic complexity O(log n): The number of operations grows at a
slower rate than the input, making the algorithm less efficient with small
inputs and more efficient with larger ones. A typical algorithm of this class is
the binary search, as described in Chapter 7 on arranging and searching data.
Do'stlaringiz bilan baham: |