Toggle navigation
Schools
Login
Sign Up
Schools
/ University of Alberta
Browse Course Documents by Department
Departments in University of Alberta
CMPUT
Courses:
4
Documents:
191
Popular Documents from University of Alberta
CMPUT | 175 | Intro to the foundations of Computation |
CMPUT | 175 | Intro to the foundations of Computation |
# find the sum of the numbers from 1 to n # growth rate O(n) because T(n) = n + 1 def sum_to_n(n): sum = 0 for i in range(n): # values 0 to n-1 sum = sum + (i+1) return sum # T(n) = 2 => constant => O(1) def sum_to_n_version2(n): return (n*(n+1))/2 d
wp1_design.docx-Description When the game starts, a
Pong V3 Translate the descript