arrow_back What is the meaning of the subsequence?

1 vote
For example, there is a sequence of pairs. This is understandable. But what does a subsequence mean? How is it implemented in C++?

1 Answer

Best answer
0 votes
It is any sequence consisting of a subset of sequence elements, preserving their order.

Whatever you think of, that's how it will work. With a vector or array of logical values, you can specify which elements of a sequence are chosen to participate in a subsequence. Or by a set of element indices. Or by an increasing array/index vector.