The basic data types python time complexity

1.list

Internal implementation is an array

 

 

2.dict

Internal implementation is hash function + Hash bucket. A good hash function Shidao value Hash bucket is only one, if multiple key hash to the same hash bucket called hash collision.

 

 

3.set

Internal implementation is dict

 

 

 

 

references:

[1] time complexity python basic data types - simple book

Guess you like

Origin www.cnblogs.com/nxf-rabbit75/p/11669900.html