Amortized complexity of data structures