I'm writing an implementation for a common array structure.
As you would find already familiar, an array is an ordered data structure that you can transform with different (hopefully self-explained) operations like:
- set object at index
- insert object(s) starting at index i
- remove object(s) starting at index i
And then you could intuitively see that you could just code a set of 'fundamental operations' from where you could construct all the other ones. For instance, you could use splice to emulate the behavior of all other operations but you could also use insert and remove to construct all of them.
My question is, then, how would you define those 'fundamental operations'?
Is splice a construct of insert and remove, therefore insert and remove being fundamental?
Or are insert and remove special cases of splice, therefore splice being the fundamental operation for the whole group?
Is there some theory or field of CS that deals with these things?
P.S. Sorry if I'm making a lot of mistakes when presenting the question. I don't know about the correct language for this and have never studied this stuff formally. I hope that I explained myself correctly.