Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

suitable name for a sequence which only grows at one end

A few times I use a restricted interface over a vector or another mutable sequence ( a sequence adapter) which only allows push_back and clear. It has some nice property such as, an iterator can be designed based on index which is always stable (like stable_vector but also has element contiguity) and hence can be stored without fear of invalidation unless it is cleared.

I want to use a adapter class instead of vector or another sequence directly to emphasize the interface (as well as to prevent any accidental mistake using unsupported operations such as insert , erase etc).

Is there any existing ADT which matches with this append_only sequence? Otherwise can anyone recommend a suitable name for this sequence adapter?

like image 492
abir Avatar asked Jan 25 '13 08:01

abir


People also ask

What are the 4 types of sequence?

There are four main types of different sequences you need to know, they are arithmetic sequences, geometric sequences, quadratic sequences and special sequences.

What do we call the sequence which has ending?

Finite sequence: {4,8,12,16,…, 64} The first of the sequence is 4 and the last term is 64 . Since the sequence has a last term, it is a finite sequence.

What are the 5 types of sequence?

Types of Sequence and SeriesArithmetic Sequences. Geometric Sequences. Harmonic Sequences. Fibonacci Numbers.

What is Fibonacci sequence pattern?

The Fibonacci sequence is a set of integers (the Fibonacci numbers) that starts with a zero, followed by a one, then by another one, and then by a series of steadily increasing numbers. The sequence follows the rule that each number is equal to the sum of the preceding two numbers.


1 Answers

I don't think there is any existing ADT to do what you want. As for the name I would go with PushOnlyVector or something of the kind. In fact I also like the append_only in your question so you may also make use of it: AppendOnlyVector. And one last option: GrowingArray. I keep the vector or array as part of the name to emphasize you support index operation.

like image 148
Ivaylo Strandjev Avatar answered Nov 07 '22 00:11

Ivaylo Strandjev