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.
Currently both
StrictStackandStrictQueueuse an amortizedO(1)time cost andO(1)space cost for their sizes. IfStrictStackcould gain anO(1)time/space complexity, and ifStrictQueuedelegated toStrictStack, it would achieve the same complexity. This should be doable with a single additional wrapper node inStrictStackthat was carried the size along with the spine.