Dropbox Interview Question

Using a binary heap categorize an array.