1. Home
  2. Explore
  3. Computer Science
  4. Data Structures Fundamentals

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Data Structures Fundamentals

  • 106Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Foundations and Complexity
A data structure organizes data so that it can be accessed, queried, or updated more
.

106 questions

  1. 1
    A data structure organizes data so that it can be accessed, queried, or updated more
    _____
    .
    Hint

    Think about the main goal of organizing data.

    Answer

    efficiently

  2. 2
    Data structures are essential ingredients in creating fast and powerful
    _____
    .
    Hint

    They help determine how efficiently a computational task can be performed.

    Answer

    algorithms

  3. 3
    An abstract data type specifies a data structure's behavior and methods, but not the details of how those methods are
    _____
    .
    Hint

    The abstraction defines an interface rather than construction details.

    Answer

    implemented

  4. 4
    A dynamic array and a linked list can both implement the abstract data type called a
    _____
    .
    Hint

    This abstract type supports adding, removing, and indexing elements.

    Answer

    list

  5. 5
    Big O notation describes an algorithm's
    _____
    -case performance.
    Hint

    It considers the least favorable arrangement of a given input size.

    Answer

    worst

  6. 6
    In Big O analysis, the variable n usually represents the
    _____
    size given to an algorithm.
    Hint

    It measures how much data the algorithm receives.

    Answer

    input

  7. 7
    When analyzing Big O, constant terms and multiplicative factors are ignored because the analysis focuses on behavior as the input becomes arbitrarily
    _____
    .
    Hint

    Consider what happens as input size tends toward infinity.

    Answer

    large

  8. 8
    For 7log⁡(n)+15n2+2n3+87\log(n) + 15n^2 + 2n^3 + 87log(n)+15n2+2n3+8, the dominant term gives a Big O complexity of
    _____
    .
    Hint

    Compare the growth rates of the terms as n increases.

    Answer

    O(n3)O(n^3)O(n3)

  9. 9
    Searching an unordered list for a value that may be in the last position takes linear time, written as
    _____
    .
    Hint

    In the worst case, every element must be checked.

    Answer

    O(n)O(n)O(n)

  10. 10
    Binary search repeatedly discards half of a sorted search range, giving it
    _____
    time complexity.
    Hint

    The number of remaining candidates is roughly halved on each iteration.

    Answer

    logarithmic

  11. 11
    Finding all subsets of a set takes exponential time because a set of n elements has 2n2^n2n
    _____
    .
    Hint

    Each element can either be included or excluded.

    Answer

    subsets

  12. 12
    Finding all permutations of a string of length n has complexity
    _____
    .
    Hint

    The number of possible orderings is a factorial function.

    Answer

    O(n!)O(n!)O(n!)

  13. 13
    Mergesort has time complexity
    _____
    .
    Hint

    Its work combines dividing the input into levels with processing across each level.

    Answer

    O(nlog⁡(n))O(n\log(n))O(nlog(n))

  14. 14
    When independent nested loops do work proportional to n and then proportional to n, their combined complexity is
    _____
    .
    Hint

    Multiply the work from the two loop levels.

    Answer

    O(n2)O(n^2)O(n2)

  15. 15
    When separate blocks of work have complexities O(n)O(n)O(n) and O(n2)O(n^2)O(n2), the combined complexity is determined by the
    _____
    term.
    Hint

    The faster-growing contribution controls the asymptotic result.

    Answer

    dominant

  16. 16
    A static array is a fixed-length container whose elements are usually stored in a
    _____
    chunk of memory.
    Hint

    The element addresses are adjacent rather than scattered among gaps.

    Answer

    contiguous

  17. 17
    In a zero-based array of length n, valid indices range from zero through
    _____
    .
    Hint

    The first element has index zero, so the last index is one less than the length.

    Answer

    n−1n-1n−1

  18. 18
    An array is indexable because each slot can be referenced by a
    _____
    .
    Hint

    This numeric position is also called the slot's index.

    Answer

    number

  19. 19
    Because array elements are indexable, accessing an element at a known index takes
    _____
    time.
    Hint

    The access does not require searching through the preceding elements.

    Answer

    constant

  20. 20
    A static array cannot grow or shrink because it has a
    _____
    size.
    Hint

    Its capacity is set when the container is created.

    Answer

    fixed

  21. 21
    When a dynamic array exceeds its capacity, one common strategy is to allocate a larger static array, copy the elements, and
    _____
    its capacity.
    Hint

    The implementation shown expands by a factor of two.

    Answer

    double

  22. 22
    Appending to a dynamic array is usually constant time on an amortized basis because resizing happens
    _____
    .
    Hint

    Most appends do not require allocating and copying a new array.

    Answer

    rarely

  23. 23
    Inserting into the middle of a dynamic array can take linear time because elements may need to be
    _____
    .
    Hint

    Existing elements must make room at the insertion position.

    Answer

    shifted

  24. 24
    A linked list is a sequential list of nodes that hold data and point to other
    _____
    .
    Hint

    The list's connections link one data-containing unit to another.

    Answer

    nodes

  25. 25
    The reference to the first element of a linked list is called its
    _____
    .
    Hint

    Traversal normally begins from this node.

    Answer

    head

  26. 26
    The last element of a linked list is called the
    _____
    .
    Hint

    It is the endpoint opposite the head.

    Answer

    tail

  27. 27
    In a singly linked list, each node contains a pointer to the
    _____
    node.
    Hint

    The list can be traversed forward through this reference.

    Answer

    next

  28. 28
    A doubly linked list differs from a singly linked list by storing a pointer to both the next and the
    _____
    node.
    Hint

    This extra reference enables traversal in the reverse direction.

    Answer

    previous

  29. 29
    A singly linked list saves memory compared with a doubly linked list because each node stores only
    _____
    link pointer.
    Hint

    It does not need an additional pointer to the preceding node.

    Answer

    one

  30. 30
    Removing a known node from the middle of a doubly linked list can take constant time because its previous and next nodes can be linked directly, provided a reference to the node is
    _____
    .
    Hint

    The operation does not need to search for the node first.

    Answer

    available

  31. 31
    Removing the tail from a singly linked list takes linear time because the list must be traversed to find the tail's new
    _____
    .
    Hint

    The old tail's preceding node must become the new endpoint.

    Answer

    predecessor

  32. 32
    In a singly linked list, inserting at the head takes
    _____
    time when the head reference is maintained.
    Hint

    The new node can be connected without traversing the list.

    Answer

    constant

  33. 33
    A stack follows the behavior called LIFO, meaning
    _____
    in, first out.
    Hint

    The most recently added element is removed first.

    Answer

    last

  34. 34
    The two primary stack operations are push and
    _____
    .
    Hint

    One operation adds to the top; the other removes from the top.

    Answer

    pop

  35. 35
    A stack implementation using a singly linked list should add new nodes before the head so that removals can be made efficiently from the
    _____
    .
    Hint

    Both stack operations should act on the same end of the list.

    Answer

    head

  36. 36
    Stacks support recursion by keeping track of previous function calls in the call
    _____
    .
    Hint

    A returning function removes its current frame and resumes the prior call.

    Answer

    stack

  37. 37
    To check whether brackets in a string match correctly, push opening brackets and compare each closing bracket with the
    _____
    bracket on the stack.
    Hint

    The most recently opened bracket must be matched first.

    Answer

    top

  38. 38
    After processing every bracket in a properly matched sequence, the stack must be
    _____
    .
    Hint

    Any unmatched opening brackets would still remain stored.

    Answer

    empty

  39. 39
    A queue adds elements at the back and removes elements from the
    _____
    .
    Hint

    This ordering models people waiting in line.

    Answer

    front

  40. 40
    Adding an element to a queue is called
    _____
    .
    Hint

    This operation places a new element at the back.

    Answer

    enqueueing

  41. 41
    Removing the front element from a queue is called
    _____
    .
    Hint

    This operation removes the element that has waited the longest.

    Answer

    dequeuing

  42. 42
    Breadth-first search uses a queue to visit graph nodes in the order they are discovered, expanding outward from the current
    _____
    .
    Hint

    This is the group of nodes awaiting exploration.

    Answer

    frontier

  43. 43
    In a queue implemented with a linked list, maintaining both head and tail references allows enqueueing and dequeuing in
    _____
    time.
    Hint

    Each operation can update an endpoint without traversing the list.

    Answer

    constant

  44. 44
    A priority queue removes the element with the highest
    _____
    according to its ordering.
    Hint

    Elements are not necessarily removed in ordinary insertion order.

    Answer

    priority

  45. 45
    A min priority queue ordered from least to greatest removes the
    _____
    element first.
    Hint

    The lower-valued elements are assigned higher priority in this ordering.

    Answer

    smallest

  46. 46
    A heap is a tree-based data structure that satisfies the heap
    _____
    .
    Hint

    This rule constrains the relationship between each parent and its children.

    Answer

    invariant

  47. 47
    In a min heap, every parent value is less than or equal to the values of its
    _____
    .
    Hint

    The root therefore contains a minimum value.

    Answer

    children

  48. 48
    In a max heap, every parent value is greater than or equal to the values of its
    _____
    .
    Hint

    The root therefore contains a maximum value.

    Answer

    children

  49. 49
    A binary heap is a heap in which each node has at most
    _____
    children.
    Hint

    The name identifies the maximum branching factor.

    Answer

    two

  50. 50
    A complete binary tree is filled at every level except possibly the last, with nodes as far to the
    _____
    as possible.
    Hint

    This arrangement determines a predictable next insertion position.

    Answer

    left

  51. 51
    A binary heap is commonly represented with an array because its complete-tree structure makes the next insertion position the
    _____
    position in the array.
    Hint

    The array stores nodes level by level from left to right.

    Answer

    last

  52. 52
    For a zero-based heap array, the left child of the node at index i is at index
    _____
    .
    Hint

    The right child is one position after the left child.

    Answer

    2i+12i+12i+1

  53. 53
    Adding a value to a binary heap and moving it toward the root to restore the heap invariant is called
    _____
    .
    Hint

    The value moves upward through the heap.

    Answer

    swimming

  54. 54
    After removing a heap root, the replacement value is moved downward by comparing it with the appropriate child; this operation is called
    _____
    .
    Hint

    The value moves away from the root to restore heap order.

    Answer

    sinking

  55. 55
    Adding an element to a binary heap takes logarithmic time because the value may need to move through the heap's
    _____
    .
    Hint

    The complete-tree shape keeps this measure logarithmic in the number of elements.

    Answer

    height

  56. 56
    Looking at the root of a binary heap without removing it is called
    _____
    .
    Hint

    This operation returns the highest-priority value while leaving the heap unchanged.

    Answer

    peeking

  57. 57
    The union-find data structure tracks elements divided into one or more
    _____
    sets.
    Hint

    Different groups do not share elements.

    Answer

    disjoint

  58. 58
    The union-find operation that identifies which group contains an element is called
    _____
    .
    Hint

    It determines the element's component or representative.

    Answer

    find

  59. 59
    The union-find operation that merges two groups is called
    _____
    .
    Hint

    It combines two previously separate components.

    Answer

    union

  60. 60
    In a union-find structure, path compression makes nodes on a searched path point directly to the component's
    _____
    node.
    Hint

    This node represents the component.

    Answer

    root

  61. 61
    Kruskal's minimum spanning tree algorithm sorts edges by ascending weight and skips an edge if its endpoints are already in the same component, because adding it would create a
    _____
    .
    Hint

    A spanning tree cannot contain a closed path.

    Answer

    cycle

  62. 62
    A minimum spanning tree connects all graph vertices using a subset of edges with
    _____
    total cost.
    Hint

    The goal is to minimize the sum of selected edge weights.

    Answer

    minimal

  63. 63
    A tree is connected and
    _____
    ; it has no cycles.
    Hint

    This property rules out closed paths.

    Answer

    acyclic

  64. 64
    A tree with n nodes has
    _____
    edges.
    Hint

    A tree has exactly one fewer edge than nodes.

    Answer

    n−1n-1n−1

  65. 65
    The topmost node selected as the starting point of a rooted tree is called its
    _____
    .
    Hint

    Other nodes can be described relative to this node.

    Answer

    root

  66. 66
    A node with no children is called a
    _____
    node.
    Hint

    Such nodes occur at the ends of branches.

    Answer

    leaf

  67. 67
    A binary search tree places smaller values in the left subtree and larger values in the
    _____
    subtree.
    Hint

    The ordering rule splits values around the current node.

    Answer

    right

  68. 68
    An inorder traversal of a binary search tree visits its values in
    _____
    order.
    Hint

    The traversal visits the left subtree, the node, and then the right subtree.

    Answer

    increasing

  69. 69
    A level-order traversal visits nodes layer by layer and is implemented using a
    _____
    .
    Hint

    Newly discovered nodes are processed in the order they are added.

    Answer

    queue

  70. 70
    A hash table maps keys to values using a technique called
    _____
    .
    Hint

    A function transforms a key into a number used to locate its entry.

    Answer

    hashing

  71. 71
    A hash function maps a key to a number in a fixed
    _____
    .
    Hint

    The output must fit the domain used to index the table.

    Answer

    range

  72. 72
    A hash function must be deterministic, so hashing the same key repeatedly always produces the same
    _____
    .
    Hint

    A changing output would prevent reliable lookup.

    Answer

    value

  73. 73
    When two different keys produce the same hash value, the event is called a hash
    _____
    .
    Hint

    The keys compete for the same table position.

    Answer

    collision

  74. 74
    Separate chaining resolves collisions by storing entries that hash to the same bucket in an auxiliary structure, commonly a
    _____
    .
    Hint

    The bucket can hold a sequence of entries.

    Answer

    linked list

  75. 75
    Open addressing resolves collisions by probing for another available position within the
    _____
    itself.
    Hint

    Unlike separate chaining, it does not store collisions in an auxiliary bucket structure.

    Answer

    table

  76. 76
    The load factor is the ratio of the number of items in a hash table to the
    _____
    of the table.
    Hint

    It measures how full the table is.

    Answer

    size

  77. 77
    Linear probing uses a probing function that changes the candidate position according to a
    _____
    function.
    Hint

    The offset grows proportionally with the probe number.

    Answer

    linear

  78. 78
    Quadratic probing changes the candidate position according to a
    _____
    function.
    Hint

    The offset commonly involves the square of the probe number.

    Answer

    quadratic

  79. 79
    Double hashing uses a secondary hash function to determine the probe
    _____
    .
    Hint

    This amount is used to move from the original hashed position.

    Answer

    offset

  80. 80
    In open addressing, a deleted entry is often replaced by a special marker called a
    _____
    .
    Hint

    Searches skip this marker rather than treating the slot as never occupied.

    Answer

    tombstone

  81. 81
    A Fenwick tree is also known as a
    _____
    tree.
    Hint

    Its name reflects its use of indexed array positions and binary structure.

    Answer

    binary indexed

  82. 82
    A Fenwick tree supports range queries and
    _____
    updates on an array.
    Hint

    An update changes a value at one array position.

    Answer

    point

  83. 83
    A Fenwick tree uses each cell to represent a range determined by the cell index's least significant
    _____
    .
    Hint

    This binary feature determines how many preceding positions the cell covers.

    Answer

    bit

  84. 84
    Fenwick tree range sums can be computed from two
    _____
    sums.
    Hint

    Subtract the accumulated total before the range from the total through its endpoint.

    Answer

    prefix

  85. 85
    Constructing a Fenwick tree by adding every array value separately takes O(nlog⁡(n))O(n\log(n))O(nlog(n)), while propagating values to parent cells can construct it in
    _____
    time.
    Hint

    The improved construction processes and propagates each position a bounded number of times.

    Answer

    linear

  86. 86
    A suffix is a nonempty substring that appears at the
    _____
    of a string.
    Hint

    Suffixes are formed by taking a string through its final character.

    Answer

    end

  87. 87
    A suffix array stores the starting indices of a string's suffixes in
    _____
    order.
    Hint

    The suffixes are ordered as words would be in a dictionary.

    Answer

    lexicographic

  88. 88
    The longest common prefix array records how many characters adjacent sorted suffixes have in
    _____
    .
    Hint

    Each entry measures the shared beginning of two neighboring suffixes.

    Answer

    common

  89. 89
    For a string of length n, the total number of substrings is n(n+1)2\frac{n(n+1)}{2}2n(n+1)​, and the sum of the LCP values counts the
    _____
    substrings.
    Hint

    Subtracting these from the total yields the number of unique substrings.

    Answer

    repeated

  90. 90
    The longest repeated substring can be found by taking the maximum value in the
    _____
    array.
    Hint

    The largest shared prefix between adjacent sorted suffixes is the longest repeated substring.

    Answer

    LCP

  91. 91
    To use a suffix array for the longest common substring problem across multiple strings, concatenate the strings with unique
    _____
    values between them.
    Hint

    These special separators prevent suffixes from running across string boundaries.

    Answer

    sentinel

  92. 92
    For the longest common substring shared by at least k strings, a sliding window over sorted suffixes must contain at least k different
    _____
    .
    Hint

    Each color identifies which original string a suffix came from.

    Answer

    colors

  93. 93
    Within a valid suffix-array window, the shared prefix length is determined by the minimum relevant
    _____
    value.
    Hint

    Every suffix in the window must share at least this many initial characters.

    Answer

    LCP

  94. 94
    An ordinary binary search tree can have linear worst-case operations if it degenerates into a
    _____
    .
    Hint

    This can happen when values are inserted in increasing order.

    Answer

    chain

  95. 95
    A balanced binary search tree adjusts its structure to maintain a height that grows
    _____
    with the number of nodes.
    Hint

    The structure avoids the linear-height chain case.

    Answer

    logarithmically

  96. 96
    Tree rotations preserve the binary search tree ordering while changing the tree's
    _____
    .
    Hint

    They rearrange parent-child relationships without changing the sorted order.

    Answer

    structure

  97. 97
    An AVL tree maintains a balance factor equal to the right subtree height minus the
    _____
    subtree height.
    Hint

    This signed difference indicates which side is taller.

    Answer

    left

  98. 98
    In an AVL tree, every node's balance factor must be one of negative one, zero, or positive
    _____
    .
    Hint

    A larger imbalance requires rotations.

    Answer

    one

  99. 99
    An AVL node with balance factor positive two is right heavy and must be repaired with suitable tree
    _____
    .
    Hint

    The repair depends on whether the imbalance is right-right or right-left.

    Answer

    rotations

  100. 100
    The four AVL imbalance cases are left-left, left-right, right-right, and
    _____
    .
    Hint

    This case is the mirror of left-right.

    Answer

    right-left

  101. 101
    An indexed priority queue supports efficient value updates and deletions by maintaining mappings between keys and heap
    _____
    .
    Hint

    These mappings allow the structure to locate a key without scanning the heap.

    Answer

    positions

  102. 102
    An indexed priority queue's position map identifies the heap node position for a given key
    _____
    .
    Hint

    This is the integer identifier associated with the key.

    Answer

    index

  103. 103
    An indexed priority queue's inverse map identifies the key index associated with a given heap
    _____
    .
    Hint

    It supports looking up which key is stored at a node.

    Answer

    position

  104. 104
    A traditional heap may need a linear search to remove a non-root value, but an indexed priority queue can locate the key in constant time and then restore heap order in
    _____
    time.
    Hint

    Repositioning a node takes time proportional to the heap's height.

    Answer

    logarithmic

  105. 105
    In a min indexed priority queue, a decrease-key operation can move the updated node
    _____
    the heap.
    Hint

    A smaller value has higher priority in a min heap.

    Answer

    up

  106. 106
    An indexed priority queue's values array is indexed by key index rather than by heap node
    _____
    .
    Hint

    The maps connect this array to the heap's changing arrangement.

    Answer

    position

1 of 106
Question 1 of 106

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent