{
 "source": "https://peabody.kids/flashcards/tech-data-structures",
 "id": "tech-data-structures",
 "title": "Data Structures",
 "category": "technology",
 "subject": "Computer Science",
 "levels": [
  "9-12",
  "college",
  "adult"
 ],
 "description": "Ways of organizing data: arrays, lists, stacks, queues, trees, graphs and hash tables.",
 "tags": [
  "data structures",
  "arrays",
  "trees",
  "graphs"
 ],
 "frontLabel": "Structure",
 "backLabel": "What it is",
 "cards": [
  [
   "Data structure",
   "A way of organizing data so it can be used efficiently"
  ],
  [
   "Array",
   "A fixed-size list of items stored in order, accessed by index"
  ],
  [
   "Index",
   "The position number of an item in an array, starting at 0 in most languages"
  ],
  [
   "Dynamic array",
   "An array that grows automatically, like a Python list"
  ],
  [
   "Linked list",
   "Items (nodes) linked by pointers, each pointing to the next"
  ],
  [
   "Node",
   "A piece of a linked structure holding data and links"
  ],
  [
   "Singly linked list",
   "Each node points only to the next"
  ],
  [
   "Doubly linked list",
   "Each node points to both the next and the previous"
  ],
  [
   "Pointer (reference)",
   "A value that tells where another value is stored"
  ],
  [
   "Stack",
   "A last-in, first-out (LIFO) structure"
  ],
  [
   "Push",
   "Add an item to a stack"
  ],
  [
   "Pop",
   "Remove the top item from a stack"
  ],
  [
   "Peek",
   "Look at the top item without removing it"
  ],
  [
   "Queue",
   "A first-in, first-out (FIFO) structure"
  ],
  [
   "Enqueue",
   "Add an item to the back of a queue"
  ],
  [
   "Dequeue",
   "Remove the item at the front of a queue"
  ],
  [
   "Deque",
   "A double-ended queue; add or remove at either end"
  ],
  [
   "Priority queue",
   "A queue where higher priority items leave first"
  ],
  [
   "Hash table (hash map)",
   "Stores key-value pairs for fast lookup using a hash function"
  ],
  [
   "Hash function",
   "Converts a key into a number to find its slot"
  ],
  [
   "Set",
   "A collection of unique items"
  ],
  [
   "Dictionary (map)",
   "A collection of key-value pairs"
  ],
  [
   "Tuple",
   "An ordered, unchangeable group of values"
  ],
  [
   "Tree",
   "A hierarchy of nodes with a root and branches"
  ],
  [
   "Root",
   "The top node of a tree"
  ],
  [
   "Leaf",
   "A node with no children"
  ],
  [
   "Parent and child",
   "A node and the nodes directly below it"
  ],
  [
   "Depth",
   "How many steps a node is from the root"
  ],
  [
   "Height of a tree",
   "The longest path from the root to a leaf"
  ],
  [
   "Binary tree",
   "A tree in which each node has at most two children"
  ],
  [
   "Binary search tree (BST)",
   "A binary tree where left values are smaller and right values are larger"
  ],
  [
   "Balanced tree",
   "A tree whose branches are roughly equal in height"
  ],
  [
   "AVL tree",
   "A self-balancing binary search tree"
  ],
  [
   "Heap",
   "A tree-based structure where the parent is always larger (or smaller) than its children"
  ],
  [
   "Min-heap",
   "The smallest element is at the top"
  ],
  [
   "Max-heap",
   "The largest element is at the top"
  ],
  [
   "Trie",
   "A tree for storing words by their letters"
  ],
  [
   "Graph",
   "Nodes (vertices) connected by edges"
  ],
  [
   "Vertex",
   "A node in a graph"
  ],
  [
   "Edge",
   "A connection between two vertices"
  ],
  [
   "Directed graph",
   "Edges have a direction"
  ],
  [
   "Undirected graph",
   "Edges go both ways"
  ],
  [
   "Weighted graph",
   "Edges have values like distance or cost"
  ],
  [
   "Adjacency list",
   "Graph stored as a list of neighbors for each vertex"
  ],
  [
   "Adjacency matrix",
   "Graph stored as a grid showing which vertices connect"
  ],
  [
   "Cycle",
   "A path that returns to its starting vertex"
  ],
  [
   "Tree vs graph",
   "A tree is a graph with no cycles that is connected"
  ],
  [
   "Record (struct)",
   "A bundle of named fields"
  ],
  [
   "String",
   "A sequence of characters"
  ],
  [
   "Matrix",
   "A grid of values in rows and columns"
  ],
  [
   "2D array",
   "An array of arrays, like a grid"
  ],
  [
   "Stack use",
   "Undo buttons, function calls, browser back"
  ],
  [
   "Queue use",
   "Print jobs, task scheduling"
  ],
  [
   "Hash table use",
   "Fast lookups, caches, counting"
  ],
  [
   "Tree use",
   "File systems, search, hierarchies"
  ],
  [
   "Graph use",
   "Maps, social networks, the internet"
  ],
  [
   "Access time of an array by index",
   "O(1)"
  ],
  [
   "Search time in an unsorted array",
   "O(n)"
  ],
  [
   "Insertion at the front of a linked list",
   "O(1)"
  ],
  [
   "Search time in a balanced BST",
   "O(log n)"
  ],
  [
   "Average lookup in a hash table",
   "O(1)"
  ],
  [
   "Call stack",
   "The stack that tracks which function is running"
  ],
  [
   "Stack overflow",
   "When the call stack runs out of space, often from endless recursion"
  ],
  [
   "Abstract data type (ADT)",
   "A description of what a structure does, not how"
  ],
  [
   "Circular buffer",
   "A fixed-size queue that wraps around"
  ],
  [
   "Bloom filter",
   "A compact structure that tells if an item might be in a set"
  ],
  [
   "Union-find",
   "A structure that tracks groups of connected items"
  ],
  [
   "Immutable",
   "Cannot be changed after creation"
  ],
  [
   "Mutable",
   "Can be changed after creation"
  ]
 ]
}
