Arrays store fixed-size, same-type elements in a compact representation. Compared with lists, this can reduce per-element object overhead; lists trade extra allocated space for cheaper insertions. section 2.4.3
NumPy arrays extend this model to multiple dimensions. Reshaping or transposing can create views that share memory with the original array; shape and strides determine how positions map to that memory. section 4.0 section 4.1.2
m2x5 = linear.reshape((2, 5))
print(np.shares_memory(linear, m2x5))
print("2x5", m2x5.shape)
print("2x5 corners", m2x5[0, 0], m2x5[0, 4],
m2x5[2, 0], m2x5[2, 4])
m5x2 = m2x5.T
print(np.shares_memory(m2x5, m5x2))
print("5x2", m5x2.shape)
print("5x2 corners", m5x2[0, 0], m5x2[0, 1],
m5x2[4, 0], m5x2[4, 1])
Trace a one-dimensional array through reshape and transpose operations, checking shared memory and the resulting shapes. section 4.1.2
Doubling array elements
A simplified CPU/GPU model doubles 100 array elements: sequential CPU work is estimated at 18,200 time units, versus 240 for independent parallel threads under the stated assumptions. section 9.1.1







































