🧠

Array

  • Stores data in computer memory contiguously
    • If an array runs out of memory, it needs to be reallocated to a different block

Complexity

Average Time Space
Access O(1)O(1) O(n)O(n)
Search O(n)O(n) O(n)O(n)
Insert O(n)O(n) O(n)O(n)
Delete O(n)O(n) O(n)O(n)
Append O(1)O(1) O(n)O(n)

Computer Science Data Structure