3 ms·
If you parameterize on the type of capacity you can save even more. (But yes, same complexity - only in rare cases will you manage to store n values without O(n
by morelisp 5y ago
If you parameterize on the type of capacity you can save even more. (But yes, same complexity - only in rare cases will you manage to store n values without O(n) memory. :) )
In Go, types without pointers also make the GC's life easier. https://go.dev/src/runtime/mheap.go#L525 https://go.dev/src/runtime/mheap.go#L525