|
|
On 05/09/2011 11:19 PM, Darren New wrote:
> On 9/5/2011 14:36, Warp wrote:
>> What happens to the old heap?
>
> It's functional. The old heap is still in x, where you passed it in. Or
> x'. Or something like that.
Actually, x' is the new element you're inserting, not the heap. I didn't
give the heap itself a variable name at all.
> You would have to say
> newheap := insert 27 oldheap
> or some such. Then the old heap is in oldheap and the new heap is in
> newheap.
Quite.
(Although the actual syntax calls for "=", not ":=", but whatever.)
Post a reply to this message
|
|