Write algorithm - binaryheap.