simple heap implementation using array