Answer:
for numB in [5,8]:
for numA in [2,3]:
print(numB, numA)
Explanation:
Looking at the given output it can bee sent that the first numbers are repeated twice consecutively and the second numbers in a sequence.
This means that nested loops are used.
Assuming that the indentation will be correct in the program
The code in squence is:
for numB in [5,8]:
for numA in [2,3]:
print(numB, numA)
Answer:
A. Processes data at high speed
Explanation:
Answer:
-1
Explanation:
i = 5 and target is 4, hence the result will be -1 going to the else statement because its not equal to the target
Answer:
The linear algorithms have the efficiency O(n). And their speed is always constant. And we need to calculate the efficiency of each of the algorithms for better management and application performance. If the input is big enough then quadratic algorithms O(N*N) always perform below a linear algorithm. And hence, linear programs are better.
Explanation:
Let us take an example of single for loop.
for i in range (1,10):
print(x)
and second one:
for i in range (1,10):
for j in range(1,10):
print(i*j)
In the first single for look the algorithm is linear and it runs for 10 times, and when we increase range to 100 then it runs for 100 times. or O(N) times. However, when we consider two for loops in nested form then, it runs for 10 *10 =100 times and when we increase to 100 then it becomes, 100*100=10000 times. Thus, its complexity is O(N*N). Hence, quadratic algorithms are more complex and takes longer time to be solved.