1. Home
  2. Explore
  3. Computer Science
  4. Introduction to Algorithms

Study methods

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

Introduction to Algorithms

  • 65Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Core Concepts
An algorithm is
that takes inputs and produces an output.

65 questions

  1. 1
    An algorithm is
    _____
    that takes inputs and produces an output.
    Hint

    Think of the general kind of process an algorithm is.

    Answer

    a computational procedure

    Explanation

    An algorithm is a computational procedure that takes inputs, carries out steps, and produces an output.

  2. 2
    As a way of describing its purpose, an algorithm is a
    _____
    for solving a problem.
    Hint

    Think of a set of instructions for carrying out a computation.

    Answer

    a computational recipe

    Explanation

    An algorithm can be understood as a computational recipe for solving a problem of interest.

  3. 3
    The values supplied to an algorithm before it computes are its
    _____
    .
    Hint

    These are the values supplied to the procedure before it runs.

    Answer

    inputs

    Explanation

    An algorithm receives inputs, performs a computation, and provides outputs.

  4. 4
    After processing its inputs, an algorithm provides
    _____
    .
    Hint

    These are the results provided after the procedure runs.

    Answer

    outputs

    Explanation

    An algorithm produces outputs from its inputs after carrying out its computation.

  5. 5
    When actual values are plugged in for a problem's inputs, the resulting case is called an
    _____
    .
    Hint

    This is the term for a particular case created by choosing input values.

    Answer

    instance

    Explanation

    An instance of a problem is formed when actual values are plugged in for the problem's inputs.

  6. 6
    An algorithm tells a computer how to perform a computation through a
    _____
    .
    Hint

    Think of how a recipe directs someone through a process.

    Answer

    step-by-step procedure

    Explanation

    An algorithm specifies a sequence of steps for performing a computation.

  7. 7
    After an algorithm receives an instance, its execution is
    _____
    rather than creative.
    Hint

    The procedure follows its instructions automatically and consistently.

    Answer

    mechanical

    Explanation

    Once an instance is supplied, the algorithm runs mechanically rather than relying on creativity during execution.

  8. 8
    Modern algorithms are abstract computational recipes meant to be implemented on a
    _____
    .
    Hint

    Think of the machine on which modern algorithms are intended to run.

    Answer

    computer

    Explanation

    Algorithms are abstract recipes for computation that are meant to be implemented on a computer.

  9. 9
    For the problem of multiplying integers m and n, the required output is
    _____
    .
    Hint

    Identify the result of multiplying the two input values.

    Answer

    the product of m and n

    Explanation

    For the multiplication problem, the inputs are the integers m and n, and the required output is their product.

  10. 10
    The multiplication example becomes a particular instance when n and m are set to
    _____
    .
    Hint

    Recall the specific pair of values used to illustrate an instance.

    Answer

    121 and 234

    Explanation

    Choosing n = 121 and m = 234 gives a particular instance of the two-number multiplication problem.

  11. 11
    When multiplying 121 by 234 using the grade-school method, the first partial product, from the digit 4, is
    _____
    .
    Hint

    Multiply the multiplicand 121 by the ones digit of 234.

    Answer

    484

    Explanation

    In the grade-school multiplication example, multiplying 121 by the ones digit 4 gives the first partial product, 484.

  12. 12
    In grade-school multiplication, the partial product from the tens digit is shifted
    _____
    to the left.
    Hint

    Consider the place value of the digit 3 in 234.

    Answer

    one place

    Explanation

    The partial product from the tens digit is shifted one place to the left to reflect that the digit represents tens.

  13. 13
    The partial product obtained by multiplying 121 by the digit 3 is
    _____
    .
    Hint

    Multiply 121 by the tens digit before applying its place-value shift.

    Answer

    363

    Explanation

    Multiplying 121 by the digit 3 gives 363; in the full calculation, its place-value shift represents 3630.

  14. 14
    The partial product obtained by multiplying 121 by the digit 2 is
    _____
    .
    Hint

    Multiply 121 by the hundreds digit of 234.

    Answer

    242

    Explanation

    Multiplying 121 by the hundreds digit 2 gives the partial product 242, which represents 24200 after accounting for place value.

  15. 15
    When adding the multiplication partial products, a value that exceeds one digit is handled by
    _____
    .
    Hint

    Think of the operation that moves a value into the next column during addition.

    Answer

    carrying

    Explanation

    The grade-school addition of the partial products uses carrying when a column's total exceeds a single digit.

  16. 16
    Algorithms are not a modern invention; they have existed since the
    _____
    world.
    Hint

    Think of how far back computational procedures extend in human history.

    Answer

    ancient

    Explanation

    Algorithms are not a modern invention; procedures for computation have existed since ancient times.

  17. 17
    Some of the earliest algorithms were
    _____
    used to carry out calculations.
    Hint

    These early procedures operated on numbers and calculations.

    Answer

    numerical algorithms

    Explanation

    Some of the earliest known algorithms were numerical procedures, including methods for multiplying numbers.

  18. 18
    One practical reason people needed to multiply measured side lengths was to calculate
    _____
    .
    Hint

    Consider a quantity found by measuring both sides of a rectangle and multiplying them.

    Answer

    the area of a rectangular piece of land

    Explanation

    Measuring the sides of a rectangular plot and multiplying them was one practical reason people needed numerical algorithms.

  19. 19
    Algorithms and calculations were used to predict when
    _____
    would occur.
    Hint

    This is one of the astronomical events mentioned as something people sought to predict.

    Answer

    the next eclipse

    Explanation

    People used calculations to predict celestial and natural events, including the next eclipse.

  20. 20
    Ancient Chinese mathematicians used algorithms to calculate on
    _____
    .
    Hint

    Think of the counting device used for calculations in the example.

    Answer

    the abacus

    Explanation

    The content describes ancient Chinese mathematicians using algorithms to calculate on the abacus.

  21. 21
    Ancient Indian mathematicians invented what is now called the
    _____
    .
    Hint

    This number system represents a digit's value according to its position.

    Answer

    place value number system

    Explanation

    Ancient Indian mathematicians invented the place value number system, which enabled important arithmetic methods.

  22. 22
    Along with the place value number system, Indian mathematicians developed
    _____
    .
    Hint

    These procedures apply arithmetic operations within the number system.

    Answer

    arithmetic algorithms

    Explanation

    The development of the place value number system was accompanied by arithmetic algorithms for using it.

  23. 23
    The Greek method for calculating gcds described in the content is the
    _____
    .
    Hint

    This ancient method is named after a Greek mathematician and computes gcds.

    Answer

    Euclidean algorithm

    Explanation

    Greek mathematicians developed the Euclidean algorithm for calculating greatest common divisors, or gcds.

  24. 24
    The ancient algorithm mentioned for finding whether numbers are prime is
    _____
    .
    Hint

    Think of the ancient prime-finding method that repeatedly filters out multiples.

    Answer

    Eratosthenes' sieve

    Explanation

    The sieve of Eratosthenes is an ancient algorithm for identifying prime numbers.

  25. 25
    Calculations used to organize and predict calendar cycles are called
    _____
    .
    Hint

    These calculations help organize dates and cycles in a calendar.

    Answer

    calendrical calculations

    Explanation

    People used algorithms for calendrical calculations, alongside calculations for predicting eclipses, full moons, and tides.

  26. 26
    The name from which the word algorithm ultimately derives is that of the mathematician
    _____
    .
    Hint

    Recall the mathematician whose name is connected to the origin of the word algorithm.

    Answer

    al-Khwarizmi

    Explanation

    The word algorithm is traced to the name of the mathematician al-Khwarizmi, whose name was associated with the place Khwarazm.

  27. 27
    Although they became known in the West as Arabic numerals, they were invented by
    _____
    .
    Hint

    The numerals' Western name does not identify the people credited with inventing them in the content.

    Answer

    Indian mathematicians

    Explanation

    The numerals called Arabic numerals in the West were invented by Indian mathematicians and were transmitted through Arab traders.

  28. 28
    The demand for efficient algorithms grew dramatically with the advent of
    _____
    .
    Hint

    This invention made large-scale automated calculation practical and changed the status of algorithms.

    Answer

    computers

    Explanation

    Before computers, algorithms were often treated as an afterthought; the advent of computers created demand for efficient procedures.

  29. 29
    To multiply thousands-digit numbers or test enormous numbers for primality, computing required
    _____
    .
    Hint

    These are procedures designed to perform computations effectively, especially at large scales.

    Answer

    efficient algorithms

    Explanation

    Computers made it valuable to study procedures that could carry out large calculations efficiently, such as multiplying very long numbers.

  30. 30
    After computers created demand for efficient procedures, the study of algorithms became
    _____
    .
    Hint

    Think of the elevated academic status algorithms gained after computers appeared.

    Answer

    a first-class field of study

    Explanation

    With computers, algorithm study became a discipline in its own right rather than merely an afterthought to mathematical results.

  31. 31
    The person who introduced the model of computation discussed in the content was
    _____
    .
    Hint

    Recall the British mathematician associated with the machine model of computation.

    Answer

    Alan Turing

    Explanation

    Alan Turing developed a model of computation in the 1930s that helped clarify what a computational procedure means.

  32. 32
    Turing's model of computation is called a
    _____
    .
    Hint

    This is the name of the idealized model developed by Turing.

    Answer

    Turing machine

    Explanation

    Turing called his model of computation a Turing machine; it provides a formal framework for describing computation.

  33. 33
    Turing's model helped clarify what counts as a valid
    _____
    .
    Hint

    This is the idea whose meaning became clearer through a formal model of computation.

    Answer

    computational procedure

    Explanation

    The model of computation helped make the notion of a computational procedure well-defined rather than informal.

  34. 34
    The claim connecting the power of physically realizable computers to Turing machines is called the
    _____
    .
    Hint

    This named thesis connects physically realizable computers with Turing's model.

    Answer

    Church-Turing thesis

    Explanation

    The Church-Turing thesis states that any computer physically realizable in the world is no more powerful than a Turing machine, as described in the content.

  35. 35
    The two scholars named in the Church-Turing thesis are
    _____
    .
    Hint

    The names are the two people whose surnames appear in the thesis's title.

    Answer

    Alonzo Church and Alan Turing

    Explanation

    The Church-Turing thesis is associated with Alonzo Church and Alan Turing.

  36. 36
    The computer scientist described as highly influential in the study of modern algorithms is
    _____
    .
    Hint

    Recall the computer scientist associated with a major effort to collect and study algorithms.

    Answer

    Don Knuth

    Explanation

    The content identifies Don Knuth as instrumental in making the study of modern algorithms a serious area of computer science.

  37. 37
    To show restaurants near the searcher, a search engine can use the searcher's approximate
    _____
    .
    Hint

    This information indicates approximately where the person making the search is located.

    Answer

    GPS location

    Explanation

    A search engine can use the searcher's approximate GPS location to return nearby restaurants rather than restaurants in a distant region.

  38. 38
    A search engine can use a prebuilt
    _____
    to quickly look up locations and search terms.
    Hint

    Think of the prebuilt data structure that helps retrieve relevant results quickly.

    Answer

    index

    Explanation

    The search example uses an index built beforehand to connect geographical locations and search terms with relevant locations and information.

  39. 39
    The search index in the example is described as being more like a
    _____
    .
    Hint

    This is the data structure used as an analogy for the search index.

    Answer

    hash table

    Explanation

    The described search index is compared to a hash table, a data structure that supports fast lookups.

  40. 40
    In the restaurant-search example, each restaurant can be associated with customer
    _____
    .
    Hint

    This user-generated information may include ratings and comments about a restaurant.

    Answer

    reviews

    Explanation

    The search system can map each restaurant to information such as its reviews, helping assemble the result page.

  41. 41
    The search and page-generation process should take only
    _____
    to avoid feeling too slow.
    Hint

    This is the short response-time range described for the search process.

    Answer

    milliseconds to seconds

    Explanation

    The search must return results within milliseconds to seconds so that users do not perceive the page as too slow.

  42. 42
    Finding a route from address A to address B on a map is an example of the
    _____
    .
    Hint

    This problem seeks a route that minimizes distance or another path cost.

    Answer

    shortest path problem

    Explanation

    Finding a route between two addresses involves solving a shortest path problem on a map.

  43. 43
    A navigation service may compute
    _____
    as well as a shortest path.
    Hint

    These are other possible routes offered alongside the main route.

    Answer

    alternative paths

    Explanation

    Navigation services may provide alternative paths in addition to a shortest path so users can compare routes.

  44. 44
    To estimate travel time along a route, a navigation system considers
    _____
    .
    Hint

    This changing road condition data helps determine travel time.

    Answer

    current traffic information

    Explanation

    Navigation systems use current traffic information to estimate how long a route will take.

  45. 45
    Matching landed airplanes to airport gates is an example of an
    _____
    .
    Hint

    This problem concerns matching available resources to tasks or entities.

    Answer

    assignment problem

    Explanation

    Assigning each landed airplane to an available gate is an example of an assignment problem.

  46. 46
    Deciding the order in which planes use a runway is an example of a
    _____
    .
    Hint

    This type of problem determines when or in what order activities use limited resources.

    Answer

    scheduling problem

    Explanation

    Planning the order in which planes use runways or taxiways is a scheduling problem.

  47. 47
    A few runways serving many planes create a
    _____
    .
    Hint

    This condition arises when demand exceeds the available facilities or capacity.

    Answer

    resource constraint

    Explanation

    Airports have limited resources, such as a small number of runways and taxiways, while many planes need to use them.

  48. 48
    The scheduling of planes waiting to land is often done
    _____
    .
    Hint

    This describes how the air traffic manager often performs the scheduling rather than relying on automation.

    Answer

    manually

    Explanation

    The content notes that scheduling planes waiting to land is often handled manually, even though algorithms are relevant to such problems.

  49. 49
    Planning how available airplanes are assigned to routes is an example of
    _____
    problems.
    Hint

    This problem concerns choosing routes for vehicles to serve required journeys.

    Answer

    vehicle routing problems

    Explanation

    Planning how available airplanes serve the airline's routes is described as a vehicle routing problem.

  50. 50
    Bringing in a different plane when the scheduled aircraft is delayed or faulty illustrates
    _____
    problems.
    Hint

    This problem concerns assigning available vehicles to transportation needs.

    Answer

    vehicle assignment problems

    Explanation

    Replacing a delayed or faulty airplane with another aircraft to serve a route is an example of a vehicle assignment problem.

  51. 51
    When estimating the duration of a road journey, navigation algorithms use
    _____
    .
    Hint

    For road-route estimates, this is the up-to-date information used to assess delays.

    Answer

    current traffic information

    Explanation

    The route example considers traffic conditions, and transportation operations more broadly must respond to changing conditions that affect travel.

  52. 52
    The person responsible for scheduling planes waiting to land is the
    _____
    .
    Hint

    This person manages the flow of aircraft approaching and using an airport.

    Answer

    air traffic manager

    Explanation

    An air traffic manager coordinates planes waiting to land, especially when runway resources are limited.

  53. 53
    After an airplane lands, it must be assigned to one of the airport's
    _____
    .
    Hint

    These airport facilities are where passengers board or leave an aircraft.

    Answer

    gates

    Explanation

    After landing, each airplane must be assigned to a gate, making gate assignment a logistical challenge.

  54. 54
    Rather than reserving a specific airplane for every route, an airline usually schedules
    _____
    .
    Hint

    Think of the shared fleet that the airline allocates among its routes.

    Answer

    the airline's available airplanes

    Explanation

    Airlines generally schedule the airplanes they have available to the routes they need to fly rather than reserving one aircraft exclusively for each route.

  55. 55
    In the delivery-route example, the truck must return to its starting location, or
    _____
    .
    Hint

    This is the truck's home base and starting point for its delivery tour.

    Answer

    the depot

    Explanation

    In the package-delivery example, the truck must return to the same starting location, called the depot, after visiting delivery addresses.

  56. 56
    A delivery truck visiting many addresses and returning to its depot illustrates the
    _____
    .
    Hint

    This classic problem asks for a tour through locations that returns to its origin.

    Answer

    travelling salesperson problem

    Explanation

    Finding a truck tour that visits a set of addresses and returns to its starting point is described as the travelling salesperson problem.

  57. 57
    The travelling salesperson problem is described as
    _____
    to solve.
    Hint

    This describes the challenge of finding efficient solutions to the route-optimization problem.

    Answer

    very difficult

    Explanation

    The content emphasizes that the travelling salesperson problem is very difficult to solve efficiently.

  58. 58
    Efficiency gains in solving delivery-routing problems can result in
    _____
    .
    Hint

    Consider the practical benefit of reducing inefficiencies in delivery tours.

    Answer

    saving companies like FedEx a ton of money

    Explanation

    Even modest efficiency improvements in solving delivery-routing problems can produce substantial savings for companies such as FedEx.

  59. 59
    The residency matching program discussed in the content is based on the
    _____
    .
    Hint

    This matching procedure has a name associated with stable pairings.

    Answer

    Stable Marriage Algorithm

    Explanation

    The residency matching program described in the content is based on the Stable Marriage Algorithm.

  60. 60
    The system that assigns medical students to residency opportunities is the national
    _____
    .
    Hint

    This program coordinates medical trainees with hospitals and training positions.

    Answer

    residency match program

    Explanation

    The national residency match program assigns medical students to residency opportunities they seek.

  61. 61
    The economists associated with developing the Stable Marriage Algorithm are
    _____
    .
    Hint

    These are the two surnames associated with the stable matching algorithm in the lecture.

    Answer

    Gale and Shapley

    Explanation

    The content credits economists Gale and Shapley with the algorithm used for stable matching and notes that they received a Nobel Prize.

  62. 62
    Another application of stable matching is pairing
    _____
    .
    Hint

    This is another real-world matching application mentioned besides residency placement.

    Answer

    kidney donors to kidney patients

    Explanation

    Stable matching methods are also used to match kidney donors with kidney patients.

  63. 63
    Matching residents to hospital positions is an example of
    _____
    .
    Hint

    Think of the broad economic goal achieved by matching people with available opportunities.

    Answer

    efficient allocation of resources

    Explanation

    The matching algorithm helps allocate limited residency positions to trainees and hospitals in a way that serves the participants' needs.

  64. 64
    Along with improving efficiency and scheduling, algorithms help society
    _____
    .
    Hint

    This is one societal benefit of coordinating resources effectively.

    Answer

    avoid wastage

    Explanation

    Algorithms help society use resources efficiently, avoid waste, schedule activities, and assign jobs.

  65. 65
    The procedures that help run many everyday services, often without users noticing, are
    _____
    .
    Hint

    These computational procedures often operate behind the scenes in ordinary services.

    Answer

    algorithms

    Explanation

    Algorithms are used throughout everyday life, including searches, transportation, airport operations, delivery, and matching systems.

1 of 65
Question 1 of 65

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent