Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 439 Bytes

File metadata and controls

20 lines (13 loc) · 439 Bytes

#Simple Complexity Examples

These programs don't do anything very interesting, but they do cost different amounts of time to run.

The programs in increasing order of cost are:

  • log.cpp
  • sqrt.cpp
  • linear.cpp
  • quadratic.cpp

Compile a file with the command

g++ file.cpp

Time it by changing the value in the file input and running

time ./a.out < input

Be careful not to run quadratic.cpp with too large a value!