Question: Python Need Help in English Thank you all files are in the google drive:https://drive.google.com/open?id=1cZGJ3nz7c4IYd2mxGiW4bk3VIlveHUVP Given the following Python function, find out an asymptotically tight bound
Python
Need Help in English
Thank you
all files are in the google drive:https://drive.google.com/open?id=1cZGJ3nz7c4IYd2mxGiW4bk3VIlveHUVP
Given the following Python function, find out an asymptotically tight bound of the algorithm in term of (the length of the input list). Write your answer as Python comments in the file csc220a2.py.
def sumOfEvenSquares (seq):
""" Returns the sum of the squares of even numbers in the list
Input: seq a list of n integers
Output: the sum of the squares of even numbers in seq """
n = len (seq)
total = 0
for val in seq:
if val % 2 == 0:
total = total + val * val
return total
What i have done so far
all files are in the google drive:https://drive.google.com/open?id=1cZGJ3nz7c4IYd2mxGiW4bk3VIlveHUVP
# Part 2:
# Given the following Python function, find out an asymptotically tight
# bound of the algorithm in term of n (the length of the input list).
# Write your answer as Python comments in the file csc220a2.py.
# def sumOfEvenSquares (seq):
# """ Returns the sum of the squares of even numbers in the list
# Input: seq a list of n integers
# Output: the sum of the squares of even numbers in seq """
# n = len (seq)
# total = 0
# for val in seq:
# if val % 2 == 0:
# total = total + val * val
# return total
# Answer: O ( )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
