Shuffle (A[1..m], B[1..n], C[1..m+n]):
Shuf[0, 0] ← True
for j ← 1 to n
Shuf[0, j] ← Shuf[0, j − 1] ∧ (B[j] = C[j])
for i ← 1 to n
Shuf[i, 0] ← Shuf[i − 1, 0] ∧ (A[i] = B[i])
for j ← 1 to n
Shuf[i, j] ← False
if A[i] = C[i + j]
Shuf[i, j] ← Shuf[i, j] ∨ Shuf[i − 1, j]
if B[i] = C[i + j]
Shuf[i, j] ← Shuf[i, j] ∨ Shuf[i, j − 1]
return Shuf[m, n]
The algorithm runs in O(mn) time.
Mailto, followed by the email address.
E.g.: <span><a href="mailto:
[email protected]">Mail me!</a></span>
Answer:
The complete code is as follows:
from array import *
myArr = array('f',[3, 5, 7,3, 10])
location = myArr.index(7)
print(str("7")+" is at position "+str(location+1))
Explanation:
I made corrections to the third line of the code and I added a line
This line gets the index of 7 from the array myArr using the index keyword
location = myArr.index(7)
This line prints the position of the 7 in the array
print(str("7")+" is at position "+str(location+1))