Heap implementation using pointer
You could also use a map, associative array, or dictionary to implement a heap (like the following):

class Heap(dict):

    "Heap() -&gt; Heap instance"

    def retrieve(self, address):
        "Get the virtual value stored at the address."
        return self.get(address, 0)

    def store(self, value, address):
        "Set the virtual value meant for the address."
        if value:
            self[address] = value
        else:
            self.pop(address, None)