Python 3 Perl-like/Ruby-like shift operator for Array with O(1) complexity?

前端 未结 0 840
有刺的猬
有刺的猬 2021-01-03 21:21

I would like to use shift, as available in Perl/Ruby, in Python. The straightforward way is pop(0). Is it an O(1) operation, because I saw different answers, from O(n) to
相关标签:
回答
  • 消灭零回复
提交回复
热议问题