How are deques in Python implemented, and when are they worse than lists?

后端 未结 5 1696
南方客
南方客 2020-11-28 04:48

I\'ve recently gotten into investigating how various data structures are implemented in Python in order to make my code more efficient. In investigating how lists and deques

5条回答
  •  萌比男神i
    2020-11-28 05:17

    In addition to all the other helpful answers, here is some more information comparing the time complexity (Big-Oh) of various operations on Python lists, deques, sets, and dictionaries. This should help in selecting the right data structure for a particular problem.

提交回复
热议问题