Simplified build heap program in C++