CSCE 221-(507-509)
Programing Assignment 2
Overview MySTL Testing Todos
 All Classes Namespaces Files Functions Variables Typedefs Friends Groups Pages
Functions
timing.cpp File Reference
+ Include dependency graph for timing.cpp:

Functions

void insert_n_linear_height_tree (size_t n)
 Function to time n inserts on a linear structured tree (worst case) More...
 
void insert_n_logarithmic_height_tree (size_t n)
 Function to time n inserts on a complete binary tree (best case) More...
 
void insert_n_random (size_t n)
 Function to time n inserts of random data (avg case) More...
 
template<typename Func >
void time_function (Func f, size_t max_size, string name)
 Control timing of a single function. More...
 
int main ()
 Main function to time all your functions. More...
 

Function Documentation

void insert_n_linear_height_tree ( size_t  n)

Function to time n inserts on a linear structured tree (worst case)

Parameters
nInput size
void insert_n_logarithmic_height_tree ( size_t  n)

Function to time n inserts on a complete binary tree (best case)

Parameters
nInput size
void insert_n_random ( size_t  n)

Function to time n inserts of random data (avg case)

Parameters
nInput size
template<typename Func >
void time_function ( Func  f,
size_t  max_size,
string  name 
)

Control timing of a single function.

Template Parameters
FuncFunction type
Parameters
fFunction taking a single size_t parameter
max_sizeMaximum size of test. For linear - 2^23 is good, for quadrati - 2^18 is probably good enough, but its up to you.
nameName of function for nice output

Essentially this function outputs timings for powers of 2 from 2 to max_size. For each timing it repeats the test at least 10 times to ensure a good average time.

int main ( )

Main function to time all your functions.