Mike Lam, Professor
CS240 Fall 2014
Mike Lam, Professor
Dynamic Arrays
Computer Memory
Lowest level: sequence of bytes Each byte has a 32-bit or 64-bit address Every byte is equally easy to access
? "Random access" memory
0000xxxx888800000000aaaadddd3210
...
...
...
Arrays
Finite sequence of uniformly-sized segments
? Starting address, item size (in bytes), item count (fixed)
Each location is a cell located at a zero-based index offset from the start
? Address of cell i is start+(i*item_size)
item_size = 4, item_count = 3
start
index:
0
1
2
3
cells
Compact Arrays
In some languages, compact byte arrays are part of the language
? Stack (C/C++)
int my_array[n]
? Heap (C/C++)
my_array = (int*)malloc(n*sizeof(int))
? Heap (C++/Java)
my_array = new int[n]
Compact Arrays
In Python, compact byte arrays of built-in types are supported by the array module
? from array import array ? my_array = array('i', [0]*n)
However, Python lists are not compact arrays! ? Referential ? Not fixed-length
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- mike s loan amortization calculator
- mike pellicciotti treasurer
- mike pellicciotti for state treasurer
- mike pence salary 2020
- mike pence vice president salary
- vp mike pence biography
- mike s classic cars omaha nebraska
- general mike milley
- mike s resume 2019
- citations needed mike rowe
- contact vice president mike pence
- mike pence home in indiana