Implementation of max-heap using array