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

后端 未结 16 2244
栀梦
栀梦 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:48

    O(1) means Random Access. In any Random Access Memory, the time taken to access any element at any location is the same. Here time can be any integer, but the only thing to remember is time taken to retrieve the element at (n-1)th or nth location will be same(ie constant).

    Whereas O(n) is dependent on the size of n.

提交回复
热议问题