- 如果我能够进一步看到,那只是因为我站在了巨人的肩膀上。 - Isaac Newton Roel SchroevenThat''s not correct. Python dictionaries are highly optimized and Ibelieve the time complexity is amortized constant (i.e. O(1)) for bothinsertions and lookups.--If I have been able to see further, it was only because I stoodon the shoulders of giants. -- Isaac NewtonRoel Schroeven Qi ren you tian :-) Llike与词典相似,剩下一些空余空间每次扩展名单 时,所有摊销成本都是O(n)。 HTH, JohnQi ren you tian :-)Llike with dictionaries, some spare space is left each time the listis expanded, so over-all the amortised cost is O(n).HTH,John 这篇关于混淆在Python中调整数组大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-21 20:20