Thom Bohdanowicz
2011-10-11 21:19:14 UTC
regarding the specifications for the first constructor (the one that
creates an empty heap of size 0 in an array of size n):
does simply initializing an array of the correct size satisfy this
description? or do we need to fill it with zeros?
also is it okay to allocate space for the array on the heap (or does
this somehow violate the O(1) requirement? i can't remember how slow
memory allocation is)?
I've coded up the data structure and it works just fine but I just don't
want to get dinged for technically not meeting the "specification"
creates an empty heap of size 0 in an array of size n):
does simply initializing an array of the correct size satisfy this
description? or do we need to fill it with zeros?
also is it okay to allocate space for the array on the heap (or does
this somehow violate the O(1) requirement? i can't remember how slow
memory allocation is)?
I've coded up the data structure and it works just fine but I just don't
want to get dinged for technically not meeting the "specification"