A stack would require in-heap operations. I think it should be possible to get away with a stack-only solution.
Maybe we'll have to resort to a heap-based approach later, we'll see.