Google Interview Question

How to implement heap algorithm?