3 ms·You could use a heap. I use Data.set because it is in the standard libraries, and it's close enough.by garrisonj 11y agoYou could use a heap. I use Data.set because it is in the standard libraries, and it's close enough.