Issue
Can anyone suggest Go container for simple and fast FIF/queue, Go has 3 different containers: heap
, list
and vector
. Which one is more suitable to implement a queue?
Solution
Either vector or list should work, but vector is probably the way to go. I say this because vector will probably allocate less often than list and garbage collection (in the current Go implementation) is fairly expensive. In a small program it probably won’t matter, though.
Answered By – Evan Shaw
Answer Checked By – Mary Flores (GoLangFix Volunteer)