CS210 Lab: Libraries and Running Time Measurement Postlab
This lab has shown that the nested loop in complexity.cpp is order
n squared (or O(n²)). This exercise asks you to create code of different
order and find the runtime.
- Modify the complexity.cpp code to find the running
time for the following cases.
Record the running time in milliseconds for:
- 0(n) a single "for" loop
- 0(1) an assignment statement
- What would you expect to happen with the run-time? Does this occur?
Back to Libraries and Running Time Measurement Lab click
Copyright: Department of Computer Science, University of Regina.