title: Why is accessing any single element in an array done in constant time ( O(1) )?
body: <p>According to <a href="http://en.wikipedia.org/wiki/Time_complexity#Constant_time" rel="noreferrer" title="Wikipedia">Wikipedia</a>, accessing any single element in an array takes constant time as only one operation has to be performed to locate it.</p>
  
  <p>To me, what happens behind the scenes probably looks something like this:</p>
  
  <p>a) The search is done linearly (e.g. I want to access element 5. I begin the search at index 0, if it's not equal to 5, I go to index 1 etc.)
  This is O(n) -- where n is the length of the array</p>
  
  <p>b) If the array is stored as a B-tree, this would give O(log n)</p>
  
  <p>I see no other approach.</p>
  
  <p>Can someone please explain why and how this is done in O(1)?</p>