asymptoticTimeComplexityClass: Asymptotic Time Complexity Classifying function

View source: R/asymptoticTimeComplexityClass.R

asymptoticTimeComplexityClassR Documentation

Asymptotic Time Complexity Classifying function

Description

Function to classify the time complexity of the expression passed onto asymptoticTimings (which outputs a data frame to be used here)

Usage

asymptoticTimeComplexityClass(model.df)

Arguments

model.df

A data frame composed of columns 'Timings' and 'Data sizes', which can be obtained by asymptoticTimings()

Details

For more information regarding its implementation or functionality/usage, please check https://anirban166.github.io//Complexity-classifiers/

Value

A string specifying the resultant complexity class. (Eg: 'Linear', 'Log-linear', 'Quadratic')

Examples

# Avoiding for CRAN since computation time might exceed 5 seconds sometimes:
## Not run: 
# Running the quick sort algorithm with sampling against a set of increasing input data sizes:
sizes = 10^seq(1, 3, by = 0.5)
df <- asymptoticTimings(sort(sample(1:100, data.sizes, replace = TRUE), method = "quick"), sizes)
# Classifying the time complexity trend based on the benchmarked data obtained above:
asymptoticTimeComplexityClass(df)
# For quick sort, the log-linear time complexity class is expected.

## End(Not run)

Anirban166/testComplexity documentation built on Sept. 17, 2024, 11:06 a.m.