Шукаєте відповіді та рішення тестів для ENG1014 Engineering Numerical Analysis - MUM S2 2025? Перегляньте нашу велику колекцію перевірених відповідей для ENG1014 Engineering Numerical Analysis - MUM S2 2025 в learning.monash.edu.
Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!
What is the time complexity of the following Python code?
A = np.zeros(5)
n = np.size(A)
for i in range(n):
A[i] = A[i]**2
for j in range(i, n):
A[j] = A[i]/5
print(A)
What is the time complexity of the following Python code?
A = np.zeros(5)
n = np.size(A)
for i in range(n):
A[i] = A[i]**2
for j in range(n):
A[j] = A[i]/5
What is the value of q after the final iteration of the inner most loop when i=30 and k=-3?
for i in range(40):
j = 4
for k in range(5,-5,-1):
s = 5 + j + k
for x in range(5,-9,-3):
q = -x*s
How many times is q calculated in the inner most loop when i=30 and k=-3?
for i in range(40):
j = 4
for k in range(5,-5,-1):
s = 5 + j + k
for x in range(5,-9,-3):
q = -x*s
What is the value of k after the following Python code?
k=0
j=1
for i in range(5):
while j < i:
k += 1
How many times are the while and for loops run in the following code? Count the total number of iterations from both the while loop and for loop.
p = 32
t = 8
while t < p:
t = t + np.floor(p/np.pi)
for k in range(0,10,2):
p = p+2
How many times in total will q be computed in the two for loops?
import numpy as np
q = 1
for i in np.arange(0, 100, np.pi):
q = i*q
for j in np.arange(100,-1,-1):
q = j/np.pi + q
How many times is the while loop run during the final iteration of the for loop?
for i in range(5,1,-1):
k = -5
while k < i:
k = k + 1
i = i - 1
What is the value of count after the following commands?
c = np.array([[6, 1, 4], [2, 1, 5], [3, 7, 1]])
n = len(c)
count = 0
for i in range(n):
for j in range(n):
if i==j and c[i,j]==1:
count += 1