1. Home
  2. Explore
  3. Computer Science
  4. Intro to Data Structures

Study methods

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

Intro to Data Structures

  • 48Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Data Structures Intro
A data structure is a way to store and organize data in a computer so that the data can be used
.

48 questions

  1. 1
    A data structure is a way to store and organize data in a computer so that the data can be used
    _____
    .
    Hint

    Think about the goal of using data structures.

    Answer

    efficiently

  2. 2
    When studying data structures as mathematical and logical models, we define them as
    _____
    .
    Hint

    This term describes a model that defines data and operations without implementation details.

    Answer

    abstract data types

  3. 3
    A list that can store a fixed number of elements and allows read/modify by position is called a
    _____
    list.
    Hint

    This type of list has a predetermined size that does not change.

    Answer

    static

  4. 4
    In an array-based dynamic list, when the array is full, a common strategy is to create a new array of
    _____
    the size of the previous array.
    Hint

    This size increase is chosen to balance cost and efficiency.

    Answer

    double

  5. 5
    Accessing an element in an array by index takes
    _____
    time.
    Hint

    This time does not depend on the size of the array.

    Answer

    constant

  6. 6
    Inserting an element at a given position in an array requires shifting elements and takes
    _____
    time in the worst case.
    Hint

    This time complexity is linear in the number of elements.

    Answer

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

  7. 7
    In a linked list, each node contains a data field and a field that stores the
    _____
    of the next node.
    Hint

    This field links the node to the next node in the list.

    Answer

    address

  8. 8
    The first node in a linked list is called the
    _____
    node.
    Hint

    This node is the starting point of the list.

    Answer

    head

  9. 9
    Inserting a node at the beginning of a linked list takes
    _____
    time.
    Hint

    This time does not depend on the length of the list.

    Answer

    constant

  10. 10
    In a linked list, to insert a node at the end, we must traverse the entire list, making the operation take
    _____
    time.
    Hint

    This time complexity is linear in the number of nodes.

    Answer

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

  11. 11
    A linked list node in C is typically defined as a structure with a data field and a
    _____
    field pointing to the next node.
    Hint

    This field stores the address of the next node.

    Answer

    pointer

  12. 12
    To delete a node from a linked list, we must first adjust the links so that the node is
    _____
    from the list, then free its memory.
    Hint

    This ensures the node is no longer reachable.

    Answer

    detached

  13. 13
    In a doubly linked list, each node contains an additional pointer to the
    _____
    node.
    Hint

    This pointer allows reverse traversal.

    Answer

    previous

  14. 14
    A stack is a last-in-first-out (LIFO) data structure where insertion and deletion occur at the
    _____
    of the stack.
    Hint

    This is the only accessible end.

    Answer

    top

  15. 15
    The operation of inserting an element onto a stack is called
    _____
    .
    Hint

    This is the standard term for stack insertion.

    Answer

    push

  16. 16
    The operation of removing the top element from a stack is called
    _____
    .
    Hint

    This is the standard term for stack removal.

    Answer

    pop

  17. 17
    In an array-based stack implementation, the variable that keeps track of the top index is initially set to
    _____
    to indicate an empty stack.
    Hint

    This value is not a valid array index.

    Answer

    -1

  18. 18
    A common application of a stack is to check whether
    _____
    in an expression are balanced.
    Hint

    This includes brackets and braces.

    Answer

    parentheses

  19. 19
    In the expression evaluation, postfix notation is also called
    _____
    notation.
    Hint

    This notation places the operator after the operands.

    Answer

    Reverse Polish

  20. 20
    To evaluate a postfix expression, we scan it from left to right and use a
    _____
    to store operands.
    Hint

    This data structure is used to temporarily hold values.

    Answer

    stack

  21. 21
    In a queue, insertion occurs at the
    _____
    end and deletion occurs at the front end.
    Hint

    This is also called the tail.

    Answer

    rear

  22. 22
    The queue operation that adds an element is called
    _____
    .
    Hint

    This is also sometimes called push.

    Answer

    enqueue

  23. 23
    The queue operation that removes an element from the front is called
    _____
    .
    Hint

    This is also sometimes called pop.

    Answer

    dequeue

  24. 24
    In a circular array-based queue, the next index after the last position is calculated using the
    _____
    operator.
    Hint

    This operator gives the remainder of division.

    Answer

    modulo

  25. 25
    A tree is a
    _____
    data structure, unlike arrays and linked lists which are linear.
    Hint

    Data is organized hierarchically.

    Answer

    non-linear

  26. 26
    The topmost node in a tree is called the
    _____
    .
    Hint

    This node has no parent.

    Answer

    root

  27. 27
    A node that has no children is called a
    _____
    node.
    Hint

    These are the terminal nodes.

    Answer

    leaf

  28. 28
    The number of edges in the longest path from a node to a leaf is called its
    _____
    .
    Hint

    This is a measure of distance downward.

    Answer

    height

  29. 29
    The number of edges in the path from the root to a node is called its
    _____
    .
    Hint

    This is a measure of distance from the root.

    Answer

    depth

  30. 30
    In a binary tree, each node can have at most
    _____
    children.
    Hint

    This is the defining property of a binary tree.

    Answer

    two

  31. 31
    A binary tree in which each node has either zero or two children is called a
    _____
    binary tree.
    Hint

    Also known as a proper binary tree.

    Answer

    strict

  32. 32
    A binary tree where all levels except possibly the last are completely filled, and nodes are as far left as possible, is called a
    _____
    binary tree.
    Hint

    This type is often used in heaps.

    Answer

    complete

  33. 33
    In a binary search tree, for each node, all values in the left subtree are
    _____
    than the node's value.
    Hint

    Or 'less than or equal' if duplicates are allowed.

    Answer

    lesser

  34. 34
    Searching for a value in a balanced binary search tree takes
    _____
    time.
    Hint

    This is the reason BSTs are efficient for search.

    Answer

    O(log⁡n)O(\log n)O(logn)

  35. 35
    In an in-order traversal of a binary search tree, the nodes are visited in
    _____
    order.
    Hint

    This traversal processes left subtree, then node, then right subtree.

    Answer

    sorted

  36. 36
    The pre-order traversal visits nodes in the order: root,
    _____
    , right subtree.
    Hint

    This is the 'visit left before right' order.

    Answer

    left subtree

  37. 37
    The post-order traversal visits nodes in the order: left subtree, right subtree,
    _____
    .
    Hint

    Root is visited last.

    Answer

    root

  38. 38
    To delete a node with two children in a BST, we replace it with the minimum node from its
    _____
    subtree.
    Hint

    Alternatively, the maximum from the left subtree.

    Answer

    right

  39. 39
    A graph consists of a set of vertices and a set of
    _____
    .
    Hint

    These connect pairs of vertices.

    Answer

    edges

  40. 40
    In an undirected graph, each edge is an unordered pair of vertices, meaning the connection is
    _____
    .
    Hint

    The relationship is mutual.

    Answer

    bidirectional

  41. 41
    A graph with all directed edges is called a
    _____
    graph or digraph.
    Hint

    Edges have a direction from one vertex to another.

    Answer

    directed

  42. 42
    A graph in which edges have associated values (costs) is called a
    _____
    graph.
    Hint

    These values often represent distances or costs.

    Answer

    weighted

  43. 43
    The representation of a graph using a two-dimensional array is called an
    _____
    matrix.
    Hint

    Rows and columns represent vertices.

    Answer

    adjacency

  44. 44
    For a sparse graph, a more memory-efficient representation is an
    _____
    list.
    Hint

    Each vertex has a list of its neighbors.

    Answer

    adjacency

  45. 45
    A graph is called
    _____
    connected if there is a path from any vertex to any other vertex in an undirected graph.
    Hint

    No vertex is isolated.

    Answer

    connected

  46. 46
    For a directed graph, if there is a path between every ordered pair of vertices, it is called
    _____
    connected.
    Hint

    This property requires paths in both directions.

    Answer

    strongly

  47. 47
    A walk that starts and ends at the same vertex with no repeated vertices (except the start/end) is called a
    _____
    .
    Hint

    This is a closed loop.

    Answer

    cycle

  48. 48
    A tree is an example of an
    _____
    graph (no cycles).
    Hint

    It has no cycles.

    Answer

    acyclic

1 of 48
Question 1 of 48

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent