When studying the performance of a data structure, there are three things that matter most:
In this introductory text, we will take correctness as a given; we won't consider data structures that give incorrect answers to queries or don't perform updates properly. We will, however, see data structures that make an extra effort to keep space usage to a minimum. This won't usually affect the (asymptotic) running times of operations, but can make the data structures a little slower in practice.
When studying running times in the context of data structures we tend to come across three different kinds of running time guarantees:
 , then one of these operations never
  takes longer than
, then one of these operations never
  takes longer than 
 time.
 time.
 , then this means that
  the cost of a typical operation is at most
, then this means that
  the cost of a typical operation is at most 
 .  More precisely,
  if a data structure has an amortized running time of
.  More precisely,
  if a data structure has an amortized running time of 
 ,
  then a sequence of
,
  then a sequence of  operations takes at most
 operations takes at most 
 time.
  Some individual operations may take more than
 time.
  Some individual operations may take more than 
 time but the
  average, over the entire sequence of operations, is at most
 time but the
  average, over the entire sequence of operations, is at most 
 .
.
 , this means that the
  actual running time is a random variable (see Section 1.3.4)
  and the expected value of this random variable is at most
, this means that the
  actual running time is a random variable (see Section 1.3.4)
  and the expected value of this random variable is at most 
 .
  The randomization here is with respect to random choices made by the
  data structure.
.
  The randomization here is with respect to random choices made by the
  data structure.
To understand the difference between worst-case, amortized, and expected running times, it helps to consider a financial example. Consider the cost of buying a house:
If we have enough cash on hand, we might choose to buy the house outright, with one payment of $120000. In this case, over a period of 10 years, the amortized monthly cost of buying this house is
 months
 months per month
 per month 
Now it's decision time. Should we pay the $15 worst-case monthly cost for fire insurance, or should we gamble and self-insure at an expected cost of $10 per month? Clearly, the $10 per month costs less in expectation, but we have to be able to accept the possibility that the actual cost may be much higher. In the unlikely event that the entire house burns down, the actual cost will be $120000.
These financial examples also offer insight into why we sometimes settle for an amortized or expected running time over a worst-case running time. It is often possible to get a lower expected or amortized running time than a worst-case running time. At the very least, it is very often possible to get a much simpler data structure if one is willing to settle for amortized or expected running times.
opendatastructures.org