1. Home
  2. Explore
  3. Computer Science
  4. Data Structures and Algorithms

Study methods

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

Data Structures and Algorithms

  • 63Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Algorithms and Efficiency
The step-by-step instructions used to solve a problem are called an
.

63 questions

  1. 1
    The step-by-step instructions used to solve a problem are called an
    _____
    .
    Hint

    Think of a precise procedure for completing a task.

    Answer

    algorithm

  2. 2
    The way data is arranged inside computer memory can have a significant effect on an algorithm's
    _____
    .
    Hint

    Consider how quickly or efficiently the algorithm runs.

    Answer

    performance

  3. 3
    Searching an unsorted collection one element at a time has a worst-case running time of
    _____
    .
    Hint

    The number of steps grows directly with the number of elements.

    Answer

    linear time

  4. 4
    Binary search repeatedly divides a sorted problem into
    _____
    parts.
    Hint

    The prefix in the word binary refers to this number.

    Answer

    two

  5. 5
    Binary search requires the data to be
    _____
    before the search begins.
    Hint

    The algorithm decides which half to eliminate based on the ordering of values.

    Answer

    sorted

  6. 6
    The logarithmic running time of binary search is commonly written as big O of
    _____
    .
    Hint

    The search space is repeatedly halved.

    Answer

    log⁡2n\log_2 nlog2​n

  7. 7
    Big O notation describes an algorithm's asymptotic
    _____
    bound.
    Hint

    It limits how much time an algorithm may take as the input grows.

    Answer

    upper

  8. 8
    The notation used to express an asymptotic lower bound is capital omega, written as
    _____
    .
    Hint

    This is the Greek symbol paired conceptually with big O.

    Answer

    Ω\OmegaΩ

  9. 9
    When an algorithm's upper and lower bounds coincide, its running time can be described using capital
    _____
    .
    Hint

    This Greek letter indicates a tight bound.

    Answer

    theta

  10. 10
    A computer can jump directly to a memory location in
    _____
    time.
    Hint

    The operation takes the same amount of time regardless of the location.

    Answer

    constant time

  11. 11
    A computer's memory commonly groups 0s and 1s into units of 8 bits called a
    _____
    .
    Hint

    Eight bits make up this standard unit of digital storage.

    Answer

    byte

  12. 12
    An array is a
    _____
    block of memory whose values are stored next to one another.
    Hint

    The values occupy consecutive memory locations.

    Answer

    contiguous

  13. 13
    The first index of a six-element array using zero-based indexing is
    _____
    .
    Hint

    Counting begins with the value used to represent no offset.

    Answer

    0

  14. 14
    In zero-based indexing, the last index of an array containing n elements is
    _____
    .
    Hint

    The first element uses index 0, so the final index is one less than the number of elements.

    Answer

    n−1n - 1n−1

  15. 15
    To find the midpoint of seven indexed locations, a computer can calculate 7÷27 \div 27÷2 and
    _____
    the result.
    Hint

    The midpoint index must be an integer.

    Answer

    round down

  16. 16
    The random access in an array is possible because each element has a predictable
    _____
    from the beginning of the array.
    Hint

    Use the idea of equal spacing between elements.

    Answer

    offset

  17. 17
    RAM stands for
    _____
    Access Memory.
    Hint

    The first word describes the ability to access any byte directly.

    Answer

    Random

  18. 18
    A DIMM is a Dual In-line
    _____
    Module.
    Hint

    It is a module containing memory chips.

    Answer

    Memory

  19. 19
    In Python, a true or false value has the type
    _____
    .
    Hint

    The type name is an abbreviation for Boolean.

    Answer

    bool

  20. 20
    In Python, a number that can contain a decimal portion has the type
    _____
    .
    Hint

    This type represents a floating-point value.

    Answer

    float

  21. 21
    In Python, a whole-number value has the type
    _____
    .
    Hint

    The type name is short for integer.

    Answer

    int

  22. 22
    In Python, a sequence of characters has the type
    _____
    .
    Hint

    The type name is abbreviated from string.

    Answer

    str

  23. 23
    A Python dictionary is another name for a
    _____
    table.
    Hint

    It uses a function to map keys to locations.

    Answer

    hash

  24. 24
    A Python list resembles an array but can dynamically
    _____
    and shrink.
    Hint

    Unlike a fixed-size array, it can accommodate changing numbers of elements.

    Answer

    grow

  25. 25
    A Python set stores a collection of values with no
    _____
    .
    Hint

    Each value appears at most once.

    Answer

    duplicates

  26. 26
    A Python tuple can represent a fixed grouping such as
    _____
    or latitude and longitude.
    Hint

    Think of a coordinate pair.

    Answer

    x, y

  27. 27
    Bubble sort repeatedly compares
    _____
    elements at a time.
    Hint

    The elements are next to each other in the collection.

    Answer

    adjacent

  28. 28
    In bubble sort, the process repeats until there are no
    _____
    .
    Hint

    A pass with no exchanges indicates that the collection is ordered.

    Answer

    swaps

  29. 29
    In bubble sort, an adjacent pair is exchanged when the pair is
    _____
    .
    Hint

    The left and right values violate the desired ordering.

    Answer

    out of order

  30. 30
    In bubble sort pseudocode, if there are n elements, adjacent comparisons proceed through position
    _____
    .
    Hint

    The comparison also examines the next position, so the final starting position is one before the last index.

    Answer

    n−2n - 2n−2

  31. 31
    Selection sort repeatedly finds the
    _____
    remaining element.
    Hint

    It places the next item in sorted order at the current position.

    Answer

    smallest

  32. 32
    During selection sort, the selected minimum is swapped with the element at the current
    _____
    .
    Hint

    This is the location where the next sorted element belongs.

    Answer

    position

  33. 33
    For n elements, selection sort performs a number of comparisons that sums to n−1+n−2+⋯+1n - 1 + n - 2 + \cdots + 1n−1+n−2+⋯+1, which equals
    _____
    .
    Hint

    Use the formula for the sum of the first n−1n - 1n−1 positive integers.

    Answer

    n(n−1)2\frac{n(n - 1)}{2}2n(n−1)​

  34. 34
    Both bubble sort and selection sort have a typical asymptotic running time of
    _____
    .
    Hint

    Each algorithm performs roughly n work across roughly n passes.

    Answer

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

  35. 35
    Merge sort divides the data into smaller portions and then
    _____
    the sorted portions.
    Hint

    The algorithm's name describes the final combination step.

    Answer

    merges

  36. 36
    Merge sort has an asymptotic running time of
    _____
    .
    Hint

    It combines linear work across logarithmically many levels.

    Answer

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

  37. 37
    Merge sort can be faster than bubble sort and selection sort because it uses additional
    _____
    .
    Hint

    The algorithm temporarily stores portions of the data elsewhere.

    Answer

    space

  38. 38
    Sorting algorithms that modify the original collection without requiring a separate collection are said to work
    _____
    place.
    Hint

    The data is rearranged within its existing storage.

    Answer

    in

  39. 39
    An array's elements must be stored next to one another, so adding an element may require
    _____
    the entire array.
    Hint

    If the adjacent memory is occupied, the collection may need to move elsewhere.

    Answer

    relocating

  40. 40
    Allocating much more array space than currently needed can waste
    _____
    .
    Hint

    Reserved but unused storage cannot be used for other tasks.

    Answer

    memory

  41. 41
    The trade-off between execution time and memory usage is an example of a resource
    _____
    .
    Hint

    Improving one resource may require spending more of another.

    Answer

    trade-off

  42. 42
    A linked list stores elements that are connected by
    _____
    containing the location of another element.
    Hint

    These are represented graphically as arrows.

    Answer

    pointers

  43. 43
    The individual boxes that hold values in a linked list are called
    _____
    .
    Hint

    Each unit stores data and a link to another unit.

    Answer

    nodes

  44. 44
    The final node in a linked list indicates that there is no next node by storing a null or equivalent
    _____
    value.
    Hint

    The chain terminates at this point.

    Answer

    dead end

  45. 45
    Unlike an array, a linked list does not support constant-time
    _____
    access to an arbitrary element.
    Hint

    You cannot calculate the middle element's location directly from the beginning.

    Answer

    random

  46. 46
    Searching a linked list may require traversing from the first node to the last, giving it a worst-case running time of
    _____
    .
    Hint

    The number of links followed can grow with the number of nodes.

    Answer

    linear time

  47. 47
    A linked list requires additional space for each node's stored
    _____
    .
    Hint

    This metadata identifies where the next node is located.

    Answer

    address

  48. 48
    The main advantage of a linked list over a fixed-size array is dynamic
    _____
    and removal.
    Hint

    The structure can change size without reserving one contiguous block in advance.

    Answer

    growth

  49. 49
    Removing a node from a linked list can be done by updating the pointer so that the node is
    _____
    from the chain.
    Hint

    Think of cutting one link and reconnecting the surrounding nodes.

    Answer

    snipped

  50. 50
    A tree node with no more than two children belongs to a
    _____
    tree.
    Hint

    The prefix refers to two possible branches.

    Answer

    binary

  51. 51
    In a binary search tree, values smaller than a node are placed in its
    _____
    subtree.
    Hint

    Values larger than the node go in the opposite direction.

    Answer

    left

  52. 52
    In a binary search tree, values larger than a node are placed in its
    _____
    subtree.
    Hint

    This is the side opposite values smaller than the node.

    Answer

    right

  53. 53
    The top node of a tree is called the
    _____
    .
    Hint

    It is the starting point from which the tree grows downward.

    Answer

    root

  54. 54
    A binary search tree can support search and insertion in approximately
    _____
    time when it remains balanced.
    Hint

    Each comparison can eliminate roughly half of the remaining tree.

    Answer

    O(log⁡2n)O(\log_2 n)O(log2​n)

  55. 55
    If a binary search tree becomes long and one-sided, it can effectively devolve into a
    _____
    .
    Hint

    The tree loses its branching structure and becomes a chain.

    Answer

    linked list

  56. 56
    A binary search tree uses extra space for pointers to as many as
    _____
    children per node.
    Hint

    The structure is binary.

    Answer

    two

  57. 57
    A hash table uses a
    _____
    function to convert a key into an array location.
    Hint

    The function determines which bucket should store the key.

    Answer

    hash

  58. 58
    When two different keys map to the same hash-table location, a
    _____
    occurs.
    Hint

    Two inputs compete for the same bucket.

    Answer

    collision

  59. 59
    A hash table's inputs are called
    _____
    and the associated outputs are called values.
    Hint

    Dictionaries associate these identifiers with stored results.

    Answer

    keys

  60. 60
    Using only the first letter of a name as a hash function groups all names beginning with that letter into the same
    _____
    .
    Hint

    It is a location or category in the hash table.

    Answer

    bucket

  61. 61
    If a hash function distributes keys poorly, a hash table can degrade to
    _____
    time.
    Hint

    Many collisions can create a long linked list in one bucket.

    Answer

    linear

  62. 62
    A good hash function should minimize the number of
    _____
    between different keys.
    Hint

    Fewer competing keys make lookup more efficient.

    Answer

    collisions

  63. 63
    With a well-designed hash function and few collisions, hash-table lookup can approach
    _____
    time.
    Hint

    The lookup time is intended to be independent of the number of stored items.

    Answer

    constant

1 of 63
Question 1 of 63

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent