Dropbox interview question

Using a binary heap categorize an array.