3 ms·
Sry, the space complexity isn't improved, you save capacity322 bits though.
by omegalulw 5y ago
Sry, the space complexity isn't improved, you save capacity322 bits though.
- morelisp 5y agoIf 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