tags:

views:

80

answers:

1

can anybody suggest go-lang container for simple and fast FIFO stack, go have 3 different container pkg heap, list and vector. which is more suitable to implement FIFO stack? thanks.

+1  A: 

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.

Evan Shaw