complete the binary heap lib