2 ms·
That's pretty much the definition of it. It's what just about every language out there calls a vector. If you want a blackbox object that has Lookup(), Add() a
by joosters 12y ago
That's pretty much the definition of it. It's what just about every language out there calls a vector.
If you want a blackbox object that has Lookup(), Add() and Set() but with no guarantees about the underlying algorithm, you should probably avoid calling it a vector...
- alkonaut 12y agoA "list" can be a linked list, an array based list and so on. Would a data structure stored in an array but not supporting the correct interface be a "vector" because the secret implementation is an array?
- zamalek 12y agoQueues and stacks are typically implemented using arrays. Should a queue or stack that uses a linked list (which is how you make them lock-free, or one way to make them immutable) be called something else then?
- SideburnsOfDoom 12y ago> If you want a blackbox object that has Lookup(), Add() and Set() but with no guarantees about the underlying algorithm, you should probably avoid calling it a vector. "Vector" here is an interface. The equivalent, e.g. "interface ILinkedListVector" is considered bad practice, i.e. you do want an interface to be a back box and not leak implementation details. if it has the right operations, "Vector" (actually more like "IVector<T>") is an acceptable interface name.