Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@catupper
Created December 7, 2013 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save catupper/7838399 to your computer and use it in GitHub Desktop.
Save catupper/7838399 to your computer and use it in GitHub Desktop.
def add(array, size, max_size, x):
if size == max_size:
new_array = malloc(2*max_size)
for x in [0..max_size-1]:
new_array[x] = array[x]
max_size *= 2
array = new_array
array[size + 1] = x
return (array, size, max_size)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment