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

Study methods

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

Data Structures Introduction

  • 61Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Data Structures Overview
A
is a way to store, organize, and manage data so that a programmer can easily access or modify values.

61 questions

  1. 1
    A
    _____
    is a way to store, organize, and manage data so that a programmer can easily access or modify values.
    Hint

    Think of the fundamental concept for storing related information in computer science.

    Answer

    data structure

  2. 2
    The four common criteria used to measure data structure efficiency in Big O notation are access, search, insert, and
    _____
    .
    Hint

    It is one of the basic operations you can perform on a data structure, completing the set of four criteria.

    Answer

    delete

  3. 3
    In Big O notation, the time complexity equation uses
    _____
    to represent the number of operations needed based on the size of the data set.
    Hint

    It is a common variable used to denote the number of elements in a data set.

    Answer

    n

  4. 4
    When judging data structures using Big O, we always consider the
    _____
    case scenario to prepare for the worst conditions.
    Hint

    This ensures that the performance is acceptable even under the most demanding circumstances.

    Answer

    worst

  5. 5
    A time complexity of
    _____
    means the number of operations is constant, regardless of the data set size.
    Hint

    This is the gold standard for efficiency, often called constant time.

    Answer

    O(1)

  6. 6
    The time complexity
    _____
    is slower than O(1) but faster than O(n), and its efficiency improves as the data set grows.
    Hint

    Think of algorithms like binary search that reduce the search space by half each step.

    Answer

    O(log n)

  7. 7
    A linear time complexity equation is represented as
    _____
    .
    Hint

    The number of operations increases proportionally with the size of the data.

    Answer

    O(n)

  8. 8
    The time complexity O(n log n) is the first one considered relatively
    _____
    in terms of efficiency.
    Hint

    It is worse than O(n) and its graph shows an increasing slope.

    Answer

    bad

  9. 9
    An array's size cannot be changed once it is
    _____
    .
    Hint

    This is a key limitation that distinguishes arrays from other data structures.

    Answer

    created

  10. 10
    The first index of an array is always
    _____
    .
    Hint

    Think about the starting point for counting positions in programming.

    Answer

    0

  11. 11
    Accessing an element in an array has time complexity
    _____
    because the computer can calculate the memory address instantly.
    Hint

    This is due to contiguous storage and fixed element size.

    Answer

    O(1)

  12. 12
    Searching for an element in an unsorted array requires a
    _____
    search in the worst case, resulting in O(n) time.
    Hint

    It goes through each element one by one until the target is found.

    Answer

    linear

  13. 13
    Inserting an element at the beginning of an array requires shifting all elements to the
    _____
    , resulting in O(n) time.
    Hint

    You need to make room for the new element by moving existing elements.

    Answer

    right

  14. 14
    When using parallel arrays, each element in one array corresponds to the element in the other array at the same
    _____
    .
    Hint

    Think about how related data is aligned across multiple arrays.

    Answer

    position

  15. 15
    A two-dimensional array can be thought of as a
    _____
    .
    Hint

    It has rows and columns, similar to a grid.

    Answer

    matrix

  16. 16
    An ArrayList is fundamentally a
    _____
    array.
    Hint

    It can grow or shrink dynamically as elements are added or removed.

    Answer

    resizeable

  17. 17
    In many languages, an ArrayList is backed by an
    _____
    in memory.
    Hint

    Behind the scenes, it uses a simpler data structure to store the elements.

    Answer

    array

  18. 18
    The ArrayList method
    _____
    appends an object to the end of the list.
    Hint

    This method is used to insert elements without specifying an index.

    Answer

    add

  19. 19
    The
    _____
    method in ArrayList removes an element at a specified index or the first occurrence of an object.
    Hint

    It can take an index or an object as an argument.

    Answer

    remove

  20. 20
    The ArrayList method
    _____
    replaces the element at a specified index with a new object.
    Hint

    It takes an index and a new value to place there.

    Answer

    set

  21. 21
    The conversion method
    _____
    turns an ArrayList into an array.
    Hint

    This method returns an array containing all elements of the ArrayList.

    Answer

    toArray

  22. 22
    A stack is a sequential access data structure that follows the
    _____
    principle.
    Hint

    It's an acronym for 'Last In, First Out'.

    Answer

    LIFO

  23. 23
    In a stack, elements are added using the
    _____
    method and removed using the pop method.
    Hint

    Think about pushing plates onto a spring-loaded stack.

    Answer

    push

  24. 24
    The stack method
    _____
    allows you to view the top element without removing it.
    Hint

    It gives you a glance at the top value.

    Answer

    peek

  25. 25
    Inserting an element into a stack has time complexity
    _____
    because it only involves adding to the top.
    Hint

    The operation requires a fixed number of steps regardless of stack size.

    Answer

    O(1)

  26. 26
    A common real-world use of stacks is the
    _____
    feature in word processors.
    Hint

    It allows you to reverse the last action.

    Answer

    undo

  27. 27
    A queue is a sequential access data structure that follows the
    _____
    principle.
    Hint

    It stands for 'First In, First Out'.

    Answer

    FIFO

  28. 28
    In a queue, elements are added to the
    _____
    and removed from the front.
    Hint

    Also known as the tail.

    Answer

    back

  29. 29
    The method used to remove an element from a queue is
    _____
    .
    Hint

    It is the counterpart of enqueue.

    Answer

    dequeue

  30. 30
    Deleting from a queue has time complexity
    _____
    because you only remove from the front.
    Hint

    It takes a constant number of steps.

    Answer

    O(1)

  31. 31
    Queues are used for
    _____
    in computers, determining which tasks to complete next.
    Hint

    It's a process that manages the order of tasks to be executed.

    Answer

    job scheduling

  32. 32
    In a linked list, each element is an object called a
    _____
    that contains data and a pointer to the next node.
    Hint

    Think of it as a building block of the linked list.

    Answer

    node

  33. 33
    The last node in a linked list has its pointer set to
    _____
    to indicate the end of the list.
    Hint

    It represents nothing or absence of a reference.

    Answer

    null

  34. 34
    Adding a node to the
    _____
    of a linked list only requires setting the new node's pointer to the current head.
    Hint

    Think about inserting at the beginning.

    Answer

    head

  35. 35
    Removing a node from the middle of a linked list involves adjusting the
    _____
    of the previous node to skip over the node to be removed.
    Hint

    This is how you keep the chain intact.

    Answer

    pointer

  36. 36
    Accessing an element in a linked list has time complexity
    _____
    because you must traverse from the head.
    Hint

    You may need to go through many nodes to reach the desired one.

    Answer

    O(n)

  37. 37
    A doubly linked list has pointers to both the next node and the
    _____
    node.
    Hint

    This allows traversal in both directions.

    Answer

    previous

  38. 38
    A common use of doubly linked lists is the back and forth functionality in
    _____
    caches.
    Hint

    This allows you to navigate through previously visited web pages.

    Answer

    browser

  39. 39
    A dictionary stores data in the form of
    _____
    pairs.
    Hint

    Each element has a unique identifier and an associated value.

    Answer

    key-value

  40. 40
    In a dictionary, every key must be
    _____
    and can only have one value.
    Hint

    No two entries can share the same key.

    Answer

    unique

  41. 41
    The most common way to implement a dictionary is using a
    _____
    .
    Hint

    This data structure uses a hash function to map keys to indices.

    Answer

    hash table

  42. 42
    A hash function takes a key and returns an
    _____
    where the key's value should be stored.
    Hint

    It maps to a position in an array.

    Answer

    index

  43. 43
    When two keys hash to the same index, it is called a hash
    _____
    .
    Hint

    This requires a method to resolve the conflict.

    Answer

    collision

  44. 44
    Closed addressing resolves hash collisions by storing keys that hash to the same index in a
    _____
    .
    Hint

    Chaining uses a secondary data structure at that index.

    Answer

    linked list

  45. 45
    In a tree, the topmost node is called the
    _____
    .
    Hint

    It is the starting point of the tree.

    Answer

    root

  46. 46
    Nodes directly below a parent node are called
    _____
    nodes.
    Hint

    Think of familial relationships.

    Answer

    child

  47. 47
    A node with no children in a tree is called a
    _____
    node.
    Hint

    It is at the end of a branch.

    Answer

    leaf

  48. 48
    The height of a tree is the number of edges on the longest path from the root to a
    _____
    .
    Hint

    It measures the maximum depth.

    Answer

    leaf

  49. 49
    In a binary search tree, the left child of a parent node has a value
    _____
    the parent node.
    Hint

    This property helps in efficient searching.

    Answer

    less than

  50. 50
    Searching in a binary search tree has time complexity
    _____
    in the average case.
    Hint

    The tree structure allows you to eliminate half the nodes at each step.

    Answer

    O(log n)

  51. 51
    A try is also known as a
    _____
    tree, used for storing characters to facilitate word retrieval.
    Hint

    It stores words by common prefixes.

    Answer

    prefix

  52. 52
    In a trie, the end of a word is marked by a
    _____
    to indicate that a complete word exists at that point.
    Hint

    It tells the program to stop and recognize a word.

    Answer

    flag

  53. 53
    Tries are commonly used for features like
    _____
    on smartphones.
    Hint

    It suggests words as you type.

    Answer

    autocomplete

  54. 54
    In a min heap, the root node contains the
    _____
    value among all nodes.
    Hint

    It is the smallest element in the heap.

    Answer

    minimum

  55. 55
    After inserting a node into a heap, you may need to swap it up to maintain the heap property; this process is called
    _____
    .
    Hint

    It adjust the heap to restore order.

    Answer

    heapify

  56. 56
    The sorting algorithm that repeatedly removes the root of a heap to produce a sorted list is called
    _____
    .
    Hint

    It uses the heap data structure to sort elements.

    Answer

    heapsort

  57. 57
    A graph is composed of a set of vertices and a set of
    _____
    .
    Hint

    These are the connections between vertices.

    Answer

    edges

  58. 58
    An undirected graph is one in which the edges have no
    _____
    ; traversal can go both ways.
    Hint

    Think of a friendship where the relationship is mutual.

    Answer

    direction

  59. 59
    A graph that contains a path from a node back to itself is called a
    _____
    graph.
    Hint

    It has at least one cycle.

    Answer

    cyclic

  60. 60
    Associating a numerical value with an edge in a graph is called
    _____
    .
    Hint

    This value often represents cost or distance.

    Answer

    weighting

  61. 61
    Dijkstra's algorithm finds the shortest path from a source vertex to all others in a graph with
    _____
    edges.
    Hint

    It requires non-negative weights.

    Answer

    weighted

1 of 61
Question 1 of 61

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent