api: "YAML JSON TOON Database"
version: "1.0.0"
format: "json"
dataset:
  slug: "sorting-algorithms"
  title: "Sorting Algorithms"
  description: "Comparison of fundamental sorting algorithms with time and space complexity."
  category: "Algorithms"
  category_slug: "algorithms"
  tags: "algorithms,sorting,complexity,big-o"
  view_count: 0
data:
  - name: "Bubble Sort"
    best: "O(n)"
    average: "O(n^2)"
    worst: "O(n^2)"
    space: "O(1)"
    stable: true
    notes: "Simple but inefficient for large inputs."
  - name: "Selection Sort"
    best: "O(n^2)"
    average: "O(n^2)"
    worst: "O(n^2)"
    space: "O(1)"
    stable: false
    notes: "Minimizes swaps; good when write cost is high."
  - name: "Insertion Sort"
    best: "O(n)"
    average: "O(n^2)"
    worst: "O(n^2)"
    space: "O(1)"
    stable: true
    notes: "Efficient for small or nearly sorted datasets."
  - name: "Merge Sort"
    best: "O(n log n)"
    average: "O(n log n)"
    worst: "O(n log n)"
    space: "O(n)"
    stable: true
    notes: "Consistent performance; good for linked lists."
  - name: "Quick Sort"
    best: "O(n log n)"
    average: "O(n log n)"
    worst: "O(n^2)"
    space: "O(log n)"
    stable: false
    notes: "In-place; widely used in practice."
  - name: "Heap Sort"
    best: "O(n log n)"
    average: "O(n log n)"
    worst: "O(n log n)"
    space: "O(1)"
    stable: false
    notes: "Guaranteed O(n log n); in-place."
  - name: "Counting Sort"
    best: "O(n + k)"
    average: "O(n + k)"
    worst: "O(n + k)"
    space: "O(k)"
    stable: true
    notes: "Only for integers in bounded range."
  - name: "Radix Sort"
    best: "O(nk)"
    average: "O(nk)"
    worst: "O(nk)"
    space: "O(n + k)"
    stable: true
    notes: "Sorts by digit position; k = number of digits."
