Answer the question
In order to leave comments, you need to log in
What is the name of such a data structure?
I apologize in advance if this is "what is the name of the blue thing above the head", the education did not come out.
I am writing something more from the field of esoteric than practically useful. Everything is strongly tied to this thing:
There is something (in a single copy) that has from zero to two cells ( [], [0], [0,1]). Any one can be read. Write only (almost) to the end, while the positions of the cells are shifted and the zero is forced out. You can "flip", completely clear (then it will be []). You cannot delete a specific cell, only all. Here is the pseudocode (all this does not apply to a specific PL, it is implemented very differently):
class WHAT_IT_IS singletone {
private values = int[];
public add(auto value) {
if(this.values.length < 2)
this.values[this.values.length] = value;
else
this.values[0] = this.values[1] = value;
}
public get(bool index) {
return this.value[index];
}
public rever() {
this.values[0] = this.values[this.values.length-1] = this.values[0];
}
public clear() {
this.values = [];
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question