Amazon interview question

implement heap and tree and graph