asymptoticComplexityClassifier: Asymptotic Complexity Classifier function

View source: R/asymptoticComplexityClassifier.R

asymptoticComplexityClassifierR Documentation

Asymptotic Complexity Classifier function

Description

Function to classify the complexity trend between the two parameters as provided by asymptoticComplexityClass

Usage

asymptoticComplexityClassifier(df)

Arguments

df

A data frame returned by asymptoticComplexityClass.

Details

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

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 complexity trend between the data contained in the columns
# 'Timings' and 'Data sizes' from the data frame obtained above:
resultant.df <- data.frame('output' = df$Timings, 'size' = df$`Data sizes`)
asymptoticComplexityClassifier(resultant.df)
# For quick sort, the log-linear time complexity class is expected.

## End(Not run)

Anirban166/testComplexity documentation built on April 21, 2023, 6:15 p.m.