Is it possible to create a(n uninialized) Python list of n integers in [0,n) in O(1) time?

后端 未结 0 650
故里飘歌
故里飘歌 2020-12-04 18:31

The following Python code creates a(n initialized) list of n nonnegative integers, each of which is at most n-1:

a = [0] * n
<
相关标签:
回答
  • 消灭零回复
提交回复
热议问题