Source: https://www.cs.cornell.edu/courses/cs2110/2017fa/online/files/arrays.pdf