1. Home
  2. Explore
  3. Computer Science
  4. Searching and Sorting Algorithms

Study methods

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

Searching and Sorting Algorithms

  • 87Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Algorithm Analysis
An algorithm is a set of
instructions for solving a problem.

87 questions

  1. 1
    An algorithm is a set of
    _____
    instructions for solving a problem.
    Hint

    Think of the ordered actions needed to accomplish a task.

    Answer

    step-by-step

    Explanation

    An algorithm specifies steps to follow to solve a particular problem.

  2. 2
    In computing, sorting information means arranging it according to an order, such as smallest to largest or
    _____
    .
    Hint

    Consider a common way to order names in a list.

    Answer

    alphabetically

    Explanation

    Sorting arranges information according to a chosen ordering rule, such as numeric order or alphabetical order.

  3. 3
    The task of looking for a particular piece of information is called
    _____
    .
    Hint

    It is the process of finding whether a value or item is present.

    Answer

    searching

    Explanation

    Searching is the process of looking for specific information in a collection.

  4. 4
    Counting people one at a time requires work that grows in direct proportion to the number of people, so its growth is
    _____
    .
    Hint

    A graph of this growth is a straight line.

    Answer

    linear

    Explanation

    If each additional person requires one additional counting step, the running time grows linearly with the number of people.

  5. 5
    Counting two people at a time is still a linear-time approach, but it is faster because each step handles a
    _____
    number of people.
    Hint

    The amount handled per step does not increase with the total group size.

    Answer

    constant

    Explanation

    Counting by twos changes the constant factor in the work, but the total work still grows linearly as the group grows.

  6. 6
    In the paired attendance algorithm, each standing person combines their count with a partner's count, then one person sits, so the remaining group is approximately
    _____
    after each round.
    Hint

    Each pair becomes one person who remains standing.

    Answer

    halved

    Explanation

    Pairing people and having one member of each pair sit reduces the number still participating by about half each round.

  7. 7
    The paired attendance procedure repeats its pairing and addition steps until the process reaches a stopping condition; this repeated control structure is a
    _____
    .
    Hint

    It is a programming structure that performs steps repeatedly.

    Answer

    loop

    Explanation

    A loop repeats a sequence of steps while a condition remains true, such as continuing while people are still standing.

  8. 8
    When a problem is repeatedly divided into halves, doubling its size adds only about
    _____
    step to the number of divisions.
    Hint

    Compare the number of halving rounds needed for a group and for twice that group.

    Answer

    one

    Explanation

    Each additional halving round can account for a doubling in the original problem size.

  9. 9
    If a problem is divided in half repeatedly, multiplying its size by four adds
    _____
    halving rounds.
    Hint

    Four is obtained by doubling twice.

    Answer

    two

    Explanation

    Two extra halvings reduce a problem by a factor of four, so a fourfold increase in size adds two rounds.

  10. 10
    Time, money, and storage space are examples of limited resources whose use can be treated as an algorithm's
    _____
    .
    Hint

    It is a general term for the resources an algorithm consumes.

    Answer

    cost

    Explanation

    Algorithm cost can refer to time, memory, money, or another limited resource.

  11. 11
    An array stores its elements in adjacent locations in memory, a property described as
    _____
    storage.
    Hint

    The values are placed directly next to one another.

    Answer

    back-to-back

    Explanation

    Array elements occupy consecutive memory locations, one after another.

  12. 12
    In the basic computer model used in the lecture, code accesses
    _____
    array value at a time.
    Hint

    The computer must visit a location to inspect its value.

    Answer

    one

    Explanation

    The model assumes that a computer must access values individually rather than see an entire array at once.

  13. 13
    When an array has nnn elements and indexing starts at zero, its last valid index is
    _____
    .
    Hint

    The first element uses index zero, so the final index is one less than the element count.

    Answer

    n−1n-1n−1

    Explanation

    Zero-based indexing assigns indices from zero through n−1n-1n−1 to an array of nnn elements.

  14. 14
    Searching an array by checking its elements one at a time from one end is called
    _____
    .
    Hint

    Its name reflects moving along the elements in sequence.

    Answer

    linear search

    Explanation

    Linear search examines elements sequentially until it finds the target or reaches the end.

  15. 15
    Linear search can proceed from left to right or right to left because it does not require the array to be in a particular
    _____
    .
    Hint

    The elements do not need to be sorted for this method.

    Answer

    order

    Explanation

    Linear search checks elements one by one and can find a target regardless of the array's ordering.

  16. 16
    When the contents of lockers have no known order, checking them one by one is more dependable than choosing a direction based on
    _____
    .
    Hint

    There is no evidence that the target is more likely to be at either end.

    Answer

    guesswork

    Explanation

    Without information about the arrangement, starting at the opposite end or choosing locations randomly does not reliably improve the search.

  17. 17
    A random search order may require extra memory to remember which locations have already been
    _____
    .
    Hint

    Tracking visited lockers prevents repeatedly checking the same location.

    Answer

    opened

    Explanation

    If locations are visited randomly, the search may need to record which ones have already been examined.

  18. 18
    Binary search can discard half of the remaining candidates only when the data is
    _____
    .
    Hint

    The method relies on knowing which side contains smaller or larger values.

    Answer

    sorted

    Explanation

    Binary search uses the ordering of sorted data to decide which half can be eliminated.

  19. 19
    In binary search, if the target is smaller than the middle value, the next search is in the
    _____
    half.
    Hint

    Smaller values appear on this side when the array is sorted in ascending order.

    Answer

    left

    Explanation

    For ascending sorted data, a target smaller than the middle value must be in the left half, if it is present.

  20. 20
    In binary search, if the target is greater than the middle value, the next search is in the
    _____
    half.
    Hint

    Larger values appear on this side when the array is sorted in ascending order.

    Answer

    right

    Explanation

    For ascending sorted data, a target greater than the middle value must be in the right half, if it is present.

  21. 21
    If the target equals the value at the middle location during binary search, the algorithm can immediately return
    _____
    .
    Hint

    The search has found the requested value.

    Answer

    true

    Explanation

    The search goal is to determine whether the target is present, so finding it produces a true result.

  22. 22
    A binary search that has no locations left to examine should return
    _____
    .
    Hint

    There are no remaining candidates in which the target could appear.

    Answer

    false

    Explanation

    If the search range is empty, the target was not found and the boolean result is false.

  23. 23
    After checking the middle location in binary search, the next range excludes that location so it is not
    _____
    .
    Hint

    The value at the middle has already been compared with the target.

    Answer

    checked again

    Explanation

    The left range ends before the middle and the right range begins after it, avoiding redundant work.

  24. 24
    For an array indexed from zero, binary search can find the middle index by dividing the range's size by two and rounding
    _____
    .
    Hint

    An array index must be an integer.

    Answer

    down

    Explanation

    When the size divided by two is not an integer, rounding down gives a valid middle index.

  25. 25
    In pseudocode for linear search, returning false only after all locations have been checked prevents an early, incorrect
    _____
    .
    Hint

    The target might be in a later location even if it is not in the first one.

    Answer

    failure

    Explanation

    Returning false after checking only one location would stop the search before it had examined the rest of the array.

  26. 26
    In C, returning a value from a function immediately ends that function's
    _____
    .
    Hint

    No later statements in the function run after this point.

    Answer

    execution

    Explanation

    A return statement exits the current function and passes its result back to the caller.

  27. 27
    The running time of linear search in the worst case is expressed as
    _____
    .
    Hint

    The target may be at the final location, requiring a scan proportional to the array size.

    Answer

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

    Explanation

    In the worst case, linear search examines all nnn elements, so its upper-bound running time is O(n)O(n)O(n).

  28. 28
    The worst-case running time of binary search on sorted data is expressed as
    _____
    .
    Hint

    Each comparison halves the remaining search range.

    Answer

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

    Explanation

    Repeatedly halving a problem of size nnn takes logarithmically many steps.

  29. 29
    Big O notation describes an algorithm's
    _____
    bound on growth.
    Hint

    It describes how large the running time can grow as the input increases.

    Answer

    upper

    Explanation

    Big O provides an asymptotic upper bound on an algorithm's growth.

  30. 30
    Omega notation describes an algorithm's
    _____
    bound on growth.
    Hint

    It can describe the algorithm's best-case growth.

    Answer

    lower

    Explanation

    Omega notation gives an asymptotic lower bound on an algorithm's growth.

  31. 31
    Theta notation can describe an algorithm when its Big O and Omega bounds have the same
    _____
    .
    Hint

    The upper and lower bounds agree asymptotically.

    Answer

    order

    Explanation

    When the upper and lower bounds match in order of growth, Theta notation gives a tight asymptotic bound.

  32. 32
    When simplifying an algorithm's growth rate, Big O analysis focuses on the
    _____
    term.
    Hint

    It is the term that matters most as the input becomes very large.

    Answer

    dominant

    Explanation

    The dominant term controls growth for large inputs, so lower-order terms are ignored.

  33. 33
    For Big O growth, constant factors such as dividing a linear running time by two do not change its
    _____
    class.
    Hint

    Both versions increase proportionally to the input size.

    Answer

    growth

    Explanation

    Big O ignores constant factors, so O(n/2)O(n/2)O(n/2) and O(n)O(n)O(n) describe the same asymptotic growth class.

  34. 34
    The notation used to describe algorithm behavior as input size grows very large is called
    _____
    notation.
    Hint

    It concerns behavior as a value approaches very large sizes.

    Answer

    asymptotic

    Explanation

    Asymptotic notation describes how an algorithm's resource use grows for large input sizes.

  35. 35
    The best-case running time of linear search is in
    _____
    because the target might be the first item checked.
    Hint

    The search may finish after a fixed number of steps, independent of the array size.

    Answer

    Ω(1)\Omega(1)Ω(1)

    Explanation

    If the first element is the target, linear search takes constant time, giving a lower bound of Ω(1)\Omega(1)Ω(1).

  36. 36
    The best-case running time of binary search is also in
    _____
    because the target might be at the middle location immediately.
    Hint

    A favorable input can be found with a single comparison.

    Answer

    Ω(1)\Omega(1)Ω(1)

    Explanation

    When the middle element is the target, binary search can finish in constant time.

  37. 37
    If data will be searched only once, sorting it first may be wasteful, so a designer may choose
    _____
    instead.
    Hint

    This method does not require a preprocessing sort.

    Answer

    linear search

    Explanation

    Sorting has a cost. For a single search, scanning once may be less work than sorting and then searching.

  38. 38
    If data is searched repeatedly, the cost of preparing it for efficient searches can be spread across many searches; this is called
    _____
    the cost.
    Hint

    The preparation expense is distributed over repeated operations.

    Answer

    amortizing

    Explanation

    Repeated searches can make an initial sorting cost worthwhile because that cost is shared across many queries.

  39. 39
    A C array initialized with a known list of values in curly braces can have its size
    _____
    by the compiler.
    Hint

    The compiler can count the supplied initial values.

    Answer

    inferred

    Explanation

    When an array is initialized with a known list, the compiler can determine its size from the number of values.

  40. 40
    A for loop that searches an array from its first element typically initializes its index to
    _____
    .
    Hint

    C arrays use zero-based indexing.

    Answer

    zero

    Explanation

    The first element of a zero-indexed array is at index zero, so a left-to-right search begins there.

  41. 41
    In C, the equality operator used to compare integer values is
    _____
    .
    Hint

    It uses two equals signs rather than one assignment sign.

    Answer

    ==

    Explanation

    The operator == tests whether two values are equal; a single = assigns a value.

  42. 42
    In C, the function used to compare two strings is
    _____
    .
    Hint

    Its name abbreviates string comparison.

    Answer

    strcmp

    Explanation

    The strcmp function compares two strings character by character.

  43. 43
    When strcmp reports that two strings are equal, its return value is
    _____
    .
    Hint

    In this function, equality is indicated by a value that is neither positive nor negative.

    Answer

    zero

    Explanation

    strcmp returns zero when the strings match; a negative or positive result indicates an ordering difference.

  44. 44
    The C header that declares strcmp is
    _____
    .
    Hint

    It is the string-related header file.

    Answer

    string.h

    Explanation

    Including string.h makes the declaration of strcmp available to a C program.

  45. 45
    A strcmp result less than zero or greater than zero can indicate which string comes first in
    _____
    order.
    Hint

    The comparison uses character values rather than a language-aware dictionary rule.

    Answer

    ASCII

    Explanation

    strcmp uses character codes to compare strings, which supports ordering based on ASCII values.

  46. 46
    A phone number containing plus signs, dashes, or parentheses should be stored as a
    _____
    rather than as an integer.
    Hint

    This type can preserve punctuation as well as digits.

    Answer

    string

    Explanation

    Phone numbers can contain punctuation, so they are text data rather than ordinary integer values.

  47. 47
    Storing a phone number as a string can preserve a leading
    _____
    that would have no mathematical significance in an integer.
    Hint

    This digit can appear at the beginning of some phone numbers.

    Answer

    zero

    Explanation

    Integer representations discard leading zeros, while strings preserve them as characters.

  48. 48
    In a C program, returning zero from main conventionally indicates
    _____
    .
    Hint

    It signals that the program completed normally.

    Answer

    success

    Explanation

    A zero exit status conventionally indicates successful program completion; a nonzero status indicates an error or other condition.

  49. 49
    Separate name and phone-number arrays rely on matching indices, which can fail if their lengths or ordering are not kept in
    _____
    .
    Hint

    The corresponding entries must remain aligned.

    Answer

    sync

    Explanation

    Parallel arrays depend on each person's name and number occupying corresponding positions, creating a risk of mismatched data.

  50. 50
    A C programmer can combine related values into a custom structure using typedef and
    _____
    .
    Hint

    This keyword groups multiple fields into a single type.

    Answer

    struct

    Explanation

    A structure groups related fields, and typedef can give the resulting type a convenient name.

  51. 51
    In the phone-book example, a person structure groups a name and a phone number as
    _____
    .
    Hint

    These are the named pieces of data inside a structure.

    Answer

    fields

    Explanation

    The structure's name and number are fields that belong to the same person record.

  52. 52
    In C, the dot operator accesses a named
    _____
    within a structure.
    Hint

    It selects one component of a structured value.

    Answer

    field

    Explanation

    Dot notation, such as people[i].name, accesses a specific field in a structure.

  53. 53
    Keeping a person's name and number together in one structure is an example of data
    _____
    .
    Hint

    Related values are bundled together rather than kept in separate, independently aligned arrays.

    Answer

    encapsulation

    Explanation

    Encapsulation keeps related information together in a single data structure.

  54. 54
    An array of person structures can store multiple records while keeping each person's related values
    _____
    .
    Hint

    Each array element contains one complete record.

    Answer

    together

    Explanation

    Each element of the people array is a structure containing that person's name and number.

  55. 55
    An array is a simple data structure whose values of a given array share the same
    _____
    .
    Hint

    For example, an array may contain integers or strings.

    Answer

    type

    Explanation

    A C array stores elements of one type, whereas a structure can group fields of different types.

  56. 56
    Selection sort repeatedly finds the smallest value in the unsorted portion and swaps it into the next
    _____
    position.
    Hint

    The sorted portion grows from the beginning of the array.

    Answer

    available

    Explanation

    Each selection-sort pass places the smallest remaining value at the next position in the sorted prefix.

  57. 57
    After each pass of selection sort, the array's sorted
    _____
    grows by one element.
    Hint

    This is the already ordered section at the start of the array.

    Answer

    prefix

    Explanation

    Selection sort places one next-smallest element at the end of the sorted prefix on each pass.

  58. 58
    Selection sort swaps the smallest remaining element with the element at the current index rather than creating extra array
    _____
    .
    Hint

    The algorithm rearranges values within the original array.

    Answer

    space

    Explanation

    The demonstration swaps values in the fixed array instead of shifting elements into newly allocated locations.

  59. 59
    The comparisons made by selection sort add up to n(n−1)2\frac{n(n-1)}{2}2n(n−1)​, giving it a running time of
    _____
    .
    Hint

    The dominant term in the comparison count is proportional to the square of the input size.

    Answer

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

    Explanation

    Selection sort performs roughly n2/2n^2/2n2/2 comparisons, and Big O ignores constant factors and lower-order terms.

  60. 60
    Even when its input is already sorted, standard selection sort still scans for the smallest remaining value on every pass, so its best-case bound is
    _____
    .
    Hint

    The algorithm does not first check whether the array is already sorted.

    Answer

    Ω(n2)\Omega(n^2)Ω(n2)

    Explanation

    Selection sort performs its passes regardless of the initial order, so its best-case running time remains quadratic.

  61. 61
    Because selection sort has both an O(n2)O(n^2)O(n2) upper bound and an Ω(n2)\Omega(n^2)Ω(n2) lower bound, its tight bound is
    _____
    .
    Hint

    Use the notation for matching upper and lower growth bounds.

    Answer

    Θ(n2)\Theta(n^2)Θ(n2)

    Explanation

    Matching quadratic upper and lower bounds mean selection sort has a tight bound of Θ(n2)\Theta(n^2)Θ(n2).

  62. 62
    Bubble sort compares adjacent values and swaps them when they are
    _____
    .
    Hint

    The comparison checks whether the pair is in the required sorted arrangement.

    Answer

    out of order

    Explanation

    Bubble sort repeatedly examines neighboring elements and swaps a pair if it violates the ordering.

  63. 63
    During a left-to-right pass of bubble sort, large values move toward the end of the array by
    _____
    upward through adjacent swaps.
    Hint

    The algorithm's name describes how these values move through the list.

    Answer

    bubbling

    Explanation

    Repeated adjacent swaps move large values toward their final positions at the end of the array.

  64. 64
    In a bubble-sort pass, the final left-hand index is at most n−2n-2n−2 so that comparing it with the next index does not go beyond the array's
    _____
    .
    Hint

    The last valid array index is n−1n-1n−1.

    Answer

    boundary

    Explanation

    The algorithm accesses the current index and the next index, so the current index cannot be the last valid one.

  65. 65
    Without an early-exit optimization, bubble sort makes repeated passes and has a worst-case running time of
    _____
    .
    Hint

    There are roughly nnn passes, each examining roughly nnn adjacent pairs.

    Answer

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

    Explanation

    The nested repetition produces quadratic work in the worst case.

  66. 66
    An optimized bubble sort can stop after a pass in which it made
    _____
    .
    Hint

    If every adjacent pair was already in order, another pass is unnecessary.

    Answer

    no swaps

    Explanation

    A full pass with no swaps shows that the list is sorted, so the algorithm can terminate early.

  67. 67
    With the no-swap early exit, bubble sort has a best-case running time of
    _____
    .
    Hint

    It still needs one pass to verify that the array is already ordered.

    Answer

    Ω(n)\Omega(n)Ω(n)

    Explanation

    An already sorted array requires a single linear pass to check all adjacent pairs, giving a linear lower bound.

  68. 68
    The no-swap optimization improves bubble sort when the data is already or mostly sorted, but its worst-case bound remains
    _____
    .
    Hint

    The optimization does not eliminate repeated passes when many swaps are needed.

    Answer

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

    Explanation

    For disordered data, bubble sort can still make many passes of adjacent comparisons and swaps.

  69. 69
    A function that calls itself is described as
    _____
    .
    Hint

    The term applies to a function whose definition uses another call to itself.

    Answer

    recursive

    Explanation

    A recursive function invokes itself as part of solving a problem.

  70. 70
    A recursive algorithm avoids repeating the same problem forever by making each recursive call handle a
    _____
    problem.
    Hint

    Progress toward a stopping condition requires reducing the work still to be done.

    Answer

    smaller

    Explanation

    Recursive calls must make progress, often by operating on a smaller portion of the original input.

  71. 71
    A condition that provides an immediate answer and stops further recursive calls is a
    _____
    case.
    Hint

    It is the stopping point for a recursive definition.

    Answer

    base

    Explanation

    A base case handles a small or simple input directly, preventing recursion from continuing indefinitely.

  72. 72
    A recursive case performs more work by calling the function again on a smaller problem, while a
    _____
    case gives an immediate answer.
    Hint

    It is contrasted with the case that makes another recursive call.

    Answer

    base

    Explanation

    The recursive case reduces the problem; the base case terminates the chain of calls.

  73. 73
    In recursive binary search, searching the left or right half is a recursive call because the search procedure is applied again to a
    _____
    range.
    Hint

    Each comparison removes the middle value and one side from consideration.

    Answer

    smaller

    Explanation

    Binary search repeats its logic on one half of the remaining range, making progress toward an empty range or a match.

  74. 74
    Solving a problem with loops rather than self-calls is called
    _____
    .
    Hint

    This approach repeats instructions using loop structures.

    Answer

    iteration

    Explanation

    Iteration uses loops to repeat steps; recursion uses functions that call themselves.

  75. 75
    A recursive definition of a pyramid can describe a pyramid of a given height as a smaller pyramid plus
    _____
    .
    Hint

    Each step increases the height by a single layer.

    Answer

    one more row

    Explanation

    A pyramid of height nnn can be defined as a pyramid of height n−1n-1n−1 with one additional row.

  76. 76
    Repeated recursive calls use additional memory for each active call, so excessive recursion can exhaust the computer's
    _____
    .
    Hint

    Each call needs space to keep track of its own state.

    Answer

    memory

    Explanation

    Recursive calls consume memory while their function calls remain active; too many calls can exceed available memory.

  77. 77
    In the recursive pyramid example, a height less than or equal to zero is used as a stopping condition so no further
    _____
    calls occur.
    Hint

    The condition prevents the function from calling itself again.

    Answer

    recursive

    Explanation

    When the height reaches the base case, the function returns instead of making another recursive call.

  78. 78
    When a function calls itself, each call has its own local variables, so one call's current loop index is not automatically shared with the next call; each call has its own
    _____
    .
    Hint

    Think of each invocation as having separate local state.

    Answer

    copy

    Explanation

    Local variables belong to a particular function call, and another recursive invocation gets its own instance of those variables.

  79. 79
    Merge sort's three main operations are sorting the left half, sorting the right half, and then
    _____
    the sorted halves.
    Hint

    The final operation combines two ordered portions into one ordered list.

    Answer

    merging

    Explanation

    Merge sort recursively sorts each half and then merges the two sorted results.

  80. 80
    A list containing only one element is already sorted, so it serves as merge sort's
    _____
    case.
    Hint

    No further division or rearrangement is required for this smallest case.

    Answer

    base

    Explanation

    A one-element list needs no sorting, so recursion can stop at that base case.

  81. 81
    To merge two sorted lists, repeatedly compare their smallest unprocessed values and select the
    _____
    one next.
    Hint

    The combined output must remain in ascending order.

    Answer

    smaller

    Explanation

    The smaller of the two current values is the next value in the merged, sorted list.

  82. 82
    During the standard merge process, each input element is moved forward through its list at most once, so merging lists with nnn total elements takes
    _____
    steps.
    Hint

    The work grows in proportion to the total number of values being merged.

    Answer

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

    Explanation

    Each element is examined and added to the output once, making the merge operation linear in the total input size.

  83. 83
    Merge sort needs additional storage while combining its sorted halves, using about
    _____
    the space of the original list in the described approach.
    Hint

    The demonstration used the original data and another area for the merged result.

    Answer

    twice

    Explanation

    The described merge process uses an additional array-sized area to combine the halves, for roughly twice the original storage.

  84. 84
    In the described merge sort, the lower bound also grows as nlog⁡nn\log nnlogn, so its tight bound is
    _____
    .
    Hint

    The upper and lower bounds have the same asymptotic growth.

    Answer

    Θ(nlog⁡n)\Theta(n\log n)Θ(nlogn)

    Explanation

    Because merge sort has matching O(nlog⁡n)O(n\log n)O(nlogn) and Ω(nlog⁡n)\Omega(n\log n)Ω(nlogn) bounds, its tight bound is Θ(nlog⁡n)\Theta(n\log n)Θ(nlogn).

  85. 85
    Unlike selection sort and bubble sort, merge sort avoids repeatedly comparing many of the same values by dividing the problem and
    _____
    the sorted results.
    Hint

    The algorithm combines smaller ordered lists instead of repeatedly scanning all pairs.

    Answer

    merging

    Explanation

    Merge sort divides the data into smaller lists, sorts them, and combines the results with a linear merge at each level.

  86. 86
    When two sorted lists are merged, the two moving positions can advance only to the right, rather than repeatedly moving
    _____
    and forth.
    Hint

    Each position progresses through its own input list.

    Answer

    back

    Explanation

    The merge process advances through each input once, which avoids repeated backtracking and redundant comparisons.

  87. 87
    Because nlog⁡nn\log nnlogn grows more slowly than n2n^2n2 for large inputs, merge sort is generally faster than the two quadratic sorting algorithms discussed, though it uses more
    _____
    .
    Hint

    The extra resource is needed to hold merged values.

    Answer

    space

    Explanation

    Merge sort reduces running-time growth compared with quadratic sorts, at the cost of additional memory for merging.

1 of 87
Question 1 of 87

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent