# Big-O Complexity Class Comparison Calculator

> Big-O Complexity Class Comparison Calculator is a paid API for AI agents from data-calc.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

Compares common algorithmic growth classes (n, n log n, n², 2ⁿ, n!) at a given input size n, returning operation counts, estimated run times, and the largest n feasible within a time budget.

## Facts

- Endpoint: GET https://data-calc.x402tookit.com/big-o?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/big-o-complexity-class-comparison-calculator-1caf3bc6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_b0nblm-77lBLoSs14aQRl

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability big-o-complexity-class-comparison-calculator-1caf3bc6
```

Example prompt: Can you compare all the standard Big-O complexity classes at n=10000, assuming my machine does 1 billion operations per second, and tell me which ones are feasible within a 2-second time budget?

## When to prefer this

Choose this endpoint when you need a quick, structured comparison of multiple algorithmic complexity classes at a specific input size — especially for capacity planning, algorithm selection, or educational illustration. It is purpose-built for systems capacity reasoning and returns all major growth classes in one call, unlike general-purpose math APIs that require separate computation per class.

## Known failure modes

- n out of range (must be 1 to 1e12) returns a validation error
- missing required query parameter n returns a 400-level error
- opsPerSecond or budgetSeconds set to zero or negative may cause undefined behavior
- very large n values for 2^n and n! return approximated powers of ten rather than exact counts
- payment of 0.02 USDC not provided results in 402 Payment Required response

## How this service works

Compare growth classes (n, n log n, n^2, 2^n, n!) at a given n: operation counts, run time, largest n a time budget allows.

## Output

Returns a structured object containing, for each complexity class (n, n log n, n², 2ⁿ, n!): the estimated operation count (as a formatted string and log10 value), the estimated run time in seconds and human-readable form, whether the class is feasible within the given time budget, and the largest n that fits within the budget. Also includes a summary verdict, explanatory reasons, the configured ops-per-second and budget, and any disclaimer about approximation for very large numbers.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "n"
     ],
     "properties": {
      "n": {
       "type": "number",
       "description": "Input size n, 1 to 1e12 (for 2^n and n! the count is shown as a power of ten)"
      },
      "opsPerSecond": {
       "type": "number",
       "description": "Operations per second of your machine (default 1e9)"
      },
      "budgetSeconds": {
       "type": "number",
       "description": "Time budget in seconds for the 'largest n' column (default 1)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "n": {
       "type": [
        "null",
        "number"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "classes": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "object",
        "properties": {
         "name": {
          "type": [
           "null",
           "string"
          ]
         },
         "time": {
          "type": [
           "null",
           "string"
          ]
         },
         "class": {
          "type": [
           "null",
           "string"
          ]
         },
         "seconds": {
          "type": [
           "null",
           "number"
          ]
         },
         "operations": {
          "type": [
           "null",
           "string"
          ]
         },
         "log10Operations": {
          "type": [
           "null",
           "number"
          ]
         },
         "feasibleWithinBudget": {
          "type": [
           "boolean",
           "null"
          ]
         },
         "largestNWithinBudget": {
          "type": [
           "null",
           "number"
          ]
         }
        }
       }
      },
      "reasons": {
       "type": [
        "array",
  
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/big-o-complexity-class-comparison-calculator-1caf3bc6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from data-calc.x402tookit.com](https://www.zero.xyz/host/data-calc.x402tookit.com/llms.txt)
