std::vector<T>

  • Memory: Elements are stored contiguously on the Heap.
  • Performance: Excellent cache locality because elements are adjacent in memory. This minimizes cache misses during linear traversals.
  • Use Case: The default choice for large datasets where the size is determined at runtime.