fix bug: accept input of len 0 or 1
more optimal build max heap