Time complexity of this algorithm with 4 nested for loops
for row in range(0, height, 2): for col in range(0, width, 2): # Each pixel in the result image use the the average # colour of the 2×2 pixels from the original image # (i.e. the pixel itself in row,col and pixels in # row,col+1 — row+1,col — row+1, col+1 sumR = 0 sumG = […]
Time complexity of this algorithm with 4 nested for loops
for row in range(0, height, 2): for col in range(0, width, 2): # Each pixel in the result image use the the average # colour of the 2×2 pixels from the original image # (i.e. the pixel itself in row,col and pixels in # row,col+1 — row+1,col — row+1, col+1 sumR = 0 sumG = […]
Time complexity of this algorithm with 4 nested for loops
for row in range(0, height, 2): for col in range(0, width, 2): # Each pixel in the result image use the the average # colour of the 2×2 pixels from the original image # (i.e. the pixel itself in row,col and pixels in # row,col+1 — row+1,col — row+1, col+1 sumR = 0 sumG = […]