build minimum heap