StrictStack / StrictQueue sizeInfo time/space complexity
jnape opened this issue · 0 comments
jnape commented
Currently both StrictStack
and StrictQueue
use an amortized O(1)
time cost and O(1)
space cost for their sizes. If StrictStack
could gain an O(1)
time/space complexity, and if StrictQueue
delegated to StrictStack
, it would achieve the same complexity. This should be doable with a single additional wrapper node in StrictStack
that was carried the size along with the spine.