Looking for CMPT 140 A - Intro Computing Science & Program I (FA 2025) test answers and solutions? Browse our comprehensive collection of verified answers for CMPT 140 A - Intro Computing Science & Program I (FA 2025) at learn.twu.ca.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Consider the following big-Oh growth rates:
O(1)O(2n)O(n)O(n2)
Which big-Oh growth rate is least desireable?
An algorithm requires a total of 3n3 + 2n2 – 3n + 4 visits. In big-Oh notation, the total number of visits is of what order?
What is the last output line of the code snippet given below?
for i in range(3) : for j in range(5) : if i % 2 == j % 2 : print("*", end="") else : print(" ", end="") print()After 9 iterations of selection sort working on an list of 10
elements, what must hold true?
i = 0while i != 9 : print(i, end = " ") i = i + 2What is the output of the following code fragment?
i = 1sum = 0while i <= 11 : sum = sum + i i = i + 1print("The value of sum is", sum)A linear search has an advantage over other algorithms because of its ________.
In the best-case scenario in linear search with an array, how many comparisons are needed?