Skip to content

This repo has simple C++ programs with various runtimes. Time them and try to feel some difference in the run times.

Notifications You must be signed in to change notification settings

cisc220/complexity-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#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!

About

This repo has simple C++ programs with various runtimes. Time them and try to feel some difference in the run times.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages