API & MCP

Everything a person can do on Big-O Crossover Calculator, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

Big-O Crossover Calculator

Compares cost functions such as 50·n log n against 2·n² or 2ⁿ with your constant factors, finds every input size where one overtakes another, draws them on a log-log chart, and converts operation counts into running time at a given number of operations per second.

Inputs of Big-O Crossover Calculator
FieldTypeDefaultDescription
functions (required)table[{"label":"Merge sort","complexity":"nlogn","constant":6},{"label":"Insertion soCost functions
nMinnumber2Smallest n
nMaxnumber1000000Largest n
opsPerSecondnumber1000000000Operations per second. For converting cost into time; 10^9 is a rough figure for simple operations on one CPU core.
sizeslist["10","100","1000","10000","100000","1000000"]Input sizes for the table

Example request

Merge sort vs insertion sort

curl -X POST https://bigocrossovercalculator.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"functions":[{"label":"Merge sort","complexity":"nlogn","constant":6},{"label":"Insertion sort","complexity":"n2","constant":0.5}]}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

{
  "mcpServers": {
    "big-o-crossover-calculator": { "type": "http", "url": "https://bigocrossovercalculator.usefulweb.site/mcp" }
  }
}