Google interview question

How to implement heap algorithm?