40 Algorithms Every Programmer Should Know
上QQ阅读APP看书,第一时间看更新

The time complexity of lists

The time complexity of various functions of a list can be summarized as follows using the Big O notation:

Please note that the time taken to add an inpidual element is independent of the size of the list. Other operations mentioned in the table are dependent on the size of the list. As the size of the list gets bigger, the impact on performance becomes more pronounced.