heap and its application