What does “O(1) access time” mean?

后端 未结 16 2263
栀梦
栀梦 2020-11-28 18:21

I have seen this term \"O(1) access time\" used to mean \"quickly\" but I don\'t understand what it means. The other term that I see with it in the same context is \"O(n) ac

16条回答
  •  佛祖请我去吃肉
    2020-11-28 18:33

    It's called the Big O notation, and describes the search time for various algorithms.

    O(1) means that the worst case run time is constant. For most situation it means that you dont acctually need to search the collection, you cand find what you are searching for right away.

提交回复
热议问题