Skip to content

Consider replacing Vector and Deque with Sequence as a class (not an interface) #45

Closed
@rtheunissen

Description

@rtheunissen

The differences between Deque and Vector might be considered small enough to consider removing Vector and Sequence, and rename Deque to Sequence.

Advantages of Deque:

  • O(1) unshift and shift

Advantages of Vector:

  • 1.5x growth factor yields less average memory used than Deque's 2.0x
  • Slightly faster access time due to not having to translate into the buffer.

Sequence is also the only interface below Collection.

The important question is: is it clear enough when you would use one over the other?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions