CSC108H1 Lecture Notes - Lecture 29: Weighted Arithmetic Mean
yifanyang and 39659 others unlocked
21
CSC108H1 Full Course Notes
Verified Note
21 documents
Document Summary
Run-time of code is usually greater than operating on large input. Can be massive differences in run-time between different algorithms, even for the same problem. Knowing the shape of the run-time growth curve is valuable. Run the code and measure the run-time with different input sizes (cid:1) (cid:1) (cid:1) (cid:1) (cid:1) (cid:1) time linear log(n) Exponential - o(2^n) n(log n) more than n. less than n^2 constant time c" x n" repetitions nc 0(n) As i do something to n, the time will also behave the same way, linear. Constant number of loops doesn"t change by the length of the list. The distribution of the list, is a factor on the run-time. Input case that will take the most amount of time. Arrangement of the data that will take the longest run- time (cid:1) (cid:1) A weighted average. (time over the amount of average) (cid:1) (cid:1) (cid:1) Two chunks of code in sequence: add the time they take.