bigarray.py


Below is the syntax highlighted version of bigarray.py from §4.1 Performance.


#-----------------------------------------------------------------------
# bigarray.py
#-----------------------------------------------------------------------

import sys
import stdio
import stdarray

n = int(sys.argv[1])
a = stdarray.create1D(n, 0)
stdio.writeln('finished')

#-----------------------------------------------------------------------

# python bigarray.py 100000000
# finished

# python bigarray.py 1000000000
# finished

# python bigarray.py 10000000000
# Killed: 9


Copyright © 2000–2015, Robert Sedgewick, Kevin Wayne, and Robert Dondero.
Last updated: Fri Oct 20 20:45:16 EDT 2017.