Python: List vs Dict for look up table

后端 未结 8 897
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 10:41

I have about 10million values that I need to put in some type of look up table, so I was wondering which would be more efficient a list or dict?

I know

8条回答
  •  无人及你
    2020-11-22 10:46

    You don't actually need to store 10 million values in the table, so it's not a big deal either way.

    Hint: think about how large your result can be after the first sum of squares operation. The largest possible result will be much smaller than 10 million...

提交回复
热议问题