Suggest an editImprove this articleRefine the answer for “How is the memory address of an array element calculated?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**The address of an array element** is calculated arithmetically using the formula: start address + (index × element size). **Key point:** it is exactly this formula that makes index access in an array O(1) - the computer doesn't need to "search" for the element, only compute its address.Shown above the full answer for quick recall.Answer (EN)ImageThe address of an array element is calculated **arithmetically**, using a formula that depends on: - the address of the start of the array, - the size of one element, - and the index of the needed element. --- ### **Formula** If: - `base_address` is the address of the first element of the array, - `index` is the number of the needed element (starting from 0), - `size` is the size of one element in bytes, then: [ \text{address} = \text{base_address} + (\text{index} \times \text{size}) ] --- ### **Example** Suppose: - array `A` starts at address `1000`, - each element takes `4 bytes`, - we need to find the address of `A[3]`. Substituting: [ 1000 + (3 \times 4) = 1012 ] **The address of element** `A[3]` **is 1012.** --- ### **Why this works** An array is stored **in contiguous memory cells**, with no "gaps". So each next element sits **exactly `size` bytes further** than the previous one. The computer doesn't need to "search" for an element, it simply performs this arithmetic calculation. --- ### **Important** - It is exactly because of this scheme that index access in an array is **O(1)** (constant time). - This isn't possible with a linked list: there, elements sit in different places in memory, and you have to follow references. --- **Summary:** > The address of an array element = start address + (index × element size). > This makes an array one of the fastest structures for direct access to data.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.