{
  "api": "data-structures",
  "title": "Data Structures",
  "description": "Fundamental computer science data structures with their average-case time complexities.",
  "emoji": "🧠",
  "license": "GPL-2.0-or-later",
  "count": 20,
  "self": "https://gratisapi.com/api/data-structures/index",
  "endpoints": {
    "list": "https://gratisapi.com/api/data-structures/index",
    "item": "https://gratisapi.com/api/data-structures/{id}"
  },
  "fields": [
    "access_big_o",
    "category",
    "description",
    "id",
    "insert_big_o",
    "name",
    "search_big_o"
  ],
  "results": [
    {
      "id": "array",
      "name": "Array",
      "category": "Linear",
      "access_big_o": "O(1)",
      "search_big_o": "O(n)",
      "insert_big_o": "O(n)",
      "description": "A contiguous block of memory storing elements of the same type, indexed by position.",
      "url": "https://gratisapi.com/api/data-structures/array"
    },
    {
      "id": "dynamic-array",
      "name": "Dynamic Array",
      "category": "Linear",
      "access_big_o": "O(1)",
      "search_big_o": "O(n)",
      "insert_big_o": "O(1)",
      "description": "A resizable array that grows automatically; amortized O(1) append by doubling capacity.",
      "url": "https://gratisapi.com/api/data-structures/dynamic-array"
    },
    {
      "id": "singly-linked-list",
      "name": "Singly Linked List",
      "category": "Linear",
      "access_big_o": "O(n)",
      "search_big_o": "O(n)",
      "insert_big_o": "O(1)",
      "description": "A sequence of nodes where each node points to the next; insertion at a known position is constant.",
      "url": "https://gratisapi.com/api/data-structures/singly-linked-list"
    },
    {
      "id": "doubly-linked-list",
      "name": "Doubly Linked List",
      "category": "Linear",
      "access_big_o": "O(n)",
      "search_big_o": "O(n)",
      "insert_big_o": "O(1)",
      "description": "A linked list whose nodes point both to the next and previous nodes, allowing bidirectional traversal.",
      "url": "https://gratisapi.com/api/data-structures/doubly-linked-list"
    },
    {
      "id": "stack",
      "name": "Stack",
      "category": "Linear",
      "access_big_o": "O(n)",
      "search_big_o": "O(n)",
      "insert_big_o": "O(1)",
      "description": "A last-in, first-out (LIFO) collection supporting push and pop at one end.",
      "url": "https://gratisapi.com/api/data-structures/stack"
    },
    {
      "id": "queue",
      "name": "Queue",
      "category": "Linear",
      "access_big_o": "O(n)",
      "search_big_o": "O(n)",
      "insert_big_o": "O(1)",
      "description": "A first-in, first-out (FIFO) collection with enqueue at the rear and dequeue at the front.",
      "url": "https://gratisapi.com/api/data-structures/queue"
    },
    {
      "id": "deque",
      "name": "Deque",
      "category": "Linear",
      "access_big_o": "O(1)",
      "search_big_o": "O(n)",
      "insert_big_o": "O(1)",
      "description": "A double-ended queue allowing constant-time insertion and removal at both ends.",
      "url": "https://gratisapi.com/api/data-structures/deque"
    },
    {
      "id": "hash-table",
      "name": "Hash Table",
      "category": "Hash",
      "access_big_o": null,
      "search_big_o": "O(1)",
      "insert_big_o": "O(1)",
      "description": "Maps keys to values using a hash function; average constant-time lookup and insertion.",
      "url": "https://gratisapi.com/api/data-structures/hash-table"
    },
    {
      "id": "hash-set",
      "name": "Hash Set",
      "category": "Hash",
      "access_big_o": null,
      "search_big_o": "O(1)",
      "insert_big_o": "O(1)",
      "description": "A collection of unique elements backed by a hash table for fast membership testing.",
      "url": "https://gratisapi.com/api/data-structures/hash-set"
    },
    {
      "id": "binary-search-tree",
      "name": "Binary Search Tree",
      "category": "Tree",
      "access_big_o": "O(log n)",
      "search_big_o": "O(log n)",
      "insert_big_o": "O(log n)",
      "description": "A binary tree where each node's left subtree is smaller and right subtree is larger than the node.",
      "url": "https://gratisapi.com/api/data-structures/binary-search-tree"
    },
    {
      "id": "avl-tree",
      "name": "AVL Tree",
      "category": "Tree",
      "access_big_o": "O(log n)",
      "search_big_o": "O(log n)",
      "insert_big_o": "O(log n)",
      "description": "A self-balancing binary search tree that keeps subtree heights within one, guaranteeing log-time operations.",
      "url": "https://gratisapi.com/api/data-structures/avl-tree"
    },
    {
      "id": "red-black-tree",
      "name": "Red-Black Tree",
      "category": "Tree",
      "access_big_o": "O(log n)",
      "search_big_o": "O(log n)",
      "insert_big_o": "O(log n)",
      "description": "A self-balancing binary search tree using node colors to maintain balance during insertion and deletion.",
      "url": "https://gratisapi.com/api/data-structures/red-black-tree"
    },
    {
      "id": "b-tree",
      "name": "B-Tree",
      "category": "Tree",
      "access_big_o": "O(log n)",
      "search_big_o": "O(log n)",
      "insert_big_o": "O(log n)",
      "description": "A self-balancing multi-way tree that keeps data sorted for efficient disk-based storage and databases.",
      "url": "https://gratisapi.com/api/data-structures/b-tree"
    },
    {
      "id": "trie",
      "name": "Trie",
      "category": "Tree",
      "access_big_o": null,
      "search_big_o": "O(k)",
      "insert_big_o": "O(k)",
      "description": "A prefix tree storing strings by character, where k is the length of the key being searched or inserted.",
      "url": "https://gratisapi.com/api/data-structures/trie"
    },
    {
      "id": "binary-heap",
      "name": "Binary Heap",
      "category": "Heap",
      "access_big_o": "O(1)",
      "search_big_o": "O(n)",
      "insert_big_o": "O(log n)",
      "description": "A complete binary tree satisfying the heap property; the min or max element is always at the root.",
      "url": "https://gratisapi.com/api/data-structures/binary-heap"
    },
    {
      "id": "fibonacci-heap",
      "name": "Fibonacci Heap",
      "category": "Heap",
      "access_big_o": "O(1)",
      "search_big_o": "O(n)",
      "insert_big_o": "O(1)",
      "description": "A heap with amortized constant-time insert and decrease-key, used in advanced graph algorithms.",
      "url": "https://gratisapi.com/api/data-structures/fibonacci-heap"
    },
    {
      "id": "priority-queue",
      "name": "Priority Queue",
      "category": "Heap",
      "access_big_o": "O(1)",
      "search_big_o": "O(n)",
      "insert_big_o": "O(log n)",
      "description": "An abstract queue where each element has a priority and the highest-priority element is served first.",
      "url": "https://gratisapi.com/api/data-structures/priority-queue"
    },
    {
      "id": "adjacency-list",
      "name": "Adjacency List",
      "category": "Graph",
      "access_big_o": null,
      "search_big_o": "O(V + E)",
      "insert_big_o": "O(1)",
      "description": "A graph representation storing, for each vertex, a list of its adjacent vertices; space-efficient for sparse graphs.",
      "url": "https://gratisapi.com/api/data-structures/adjacency-list"
    },
    {
      "id": "adjacency-matrix",
      "name": "Adjacency Matrix",
      "category": "Graph",
      "access_big_o": "O(1)",
      "search_big_o": "O(1)",
      "insert_big_o": "O(1)",
      "description": "A graph representation using a V-by-V matrix where each cell marks whether an edge exists between two vertices.",
      "url": "https://gratisapi.com/api/data-structures/adjacency-matrix"
    },
    {
      "id": "skip-list",
      "name": "Skip List",
      "category": "Linear",
      "access_big_o": "O(log n)",
      "search_big_o": "O(log n)",
      "insert_big_o": "O(log n)",
      "description": "A layered linked list with express lanes that allow probabilistic logarithmic search and insertion.",
      "url": "https://gratisapi.com/api/data-structures/skip-list"
    }
  ]
}
