- #1
evinda
Gold Member
MHB
- 3,836
- 0
Hello! (Wave)
Given two lists, $L_1$ with $n_1$ elements and $L_2$ with $n_2$ elements, I want to write an algorithm that creates a new list $L_3$, for which the following stand:
$n_1,n_2$ can be any even numbers. The time complexity of the algorithm should be $O(n_1+n_2)$.
Could you give me a hint how I could do this? (Thinking)
Given two lists, $L_1$ with $n_1$ elements and $L_2$ with $n_2$ elements, I want to write an algorithm that creates a new list $L_3$, for which the following stand:
- The elements at the odd positions of $L_3$ are these that are at the even positions of $L_1$
- The elements at the even positions of $L_3$ are the last $\frac{n_1}{2}$ elements of $L_2$
$n_1,n_2$ can be any even numbers. The time complexity of the algorithm should be $O(n_1+n_2)$.
Could you give me a hint how I could do this? (Thinking)