Arrays store elements in contiguous memory and allow direct access by position. Inserting or deleting an element can require shifting others; linked lists instead require traversal to reach an element. section 1.4.2
Knapsack space optimization
A two-dimensional matrix tracks knapsack decisions, but if each state depends only on the row above and a cell up and to the left, a one-dimensional array can reduce memory use. This approach does not apply to every problem. section 7.3















































