Data Structure Complexity Analysis

Time and space complexity analysis of common data structures: Array, Linked List, Binary Search Tree, Hash Table, Heap, and Graph with Big-O notation.

The data

Structures

NameAccessSearchInsertionDeletionSpace
ArrayO(1)O(n)O(n)O(n)O(n)
Linked ListO(n)O(n)O(1)O(1)O(n)
Binary Search TreeO(log n)O(log n)O(log n)O(log n)O(n)
Hash TableN/AO(1)O(1)O(1)O(n)
HeapO(1) maxO(n)O(log n)O(log n)O(n)
Graph (Adjacency List)O(1)O(V+E)O(1)O(V+E)O(V+E)

Fetch the same bytes

The static files are identical to what the API returns, but with no rate limit and no server round trip. Use the API when you want a query and a content type; use the files when you want to cache one document.

curl "https://yjtoon.com/api/dataset/complexity-analysis?format=toon"
const res = await fetch(
  "https://yjtoon.com/static-data/dataset/complexity-analysis.toon"
);
const toon = await res.text();

Rate limit: 120 requests per minute per IP, no key and no signup. API reference →

Topics

  • algorithms
  • complexity
  • big-o
  • data structures