# NOT RUN {
# 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.
# }
Run the code above in your browser using DataLab