Howto create combinations of several vectors without hardcoding loops in C++?

前端 未结 10 1021
慢半拍i
慢半拍i 2020-11-29 08:40

I have several data that looks like this:

Vector1_elements = T,C,A
Vector2_elements = C,G,A
Vector3_elements = C,G,T
..... up to ...
VectorK_elements = ...

         


        
10条回答
  •  感情败类
    2020-11-29 09:11

    The simplest way to approach this is to use recursion. The function will have one loop in it and will call itself, merging itself with the output of the recursive call. Of course, recursion can be converted to iteration if you're worried about stack space, but at least as a starting point, the recursive solution will probably be easiest for you.

提交回复
热议问题