We briefly discussed what we mean by algorithms in Chapter 1, but perhaps it bears repeating; algorithms are recipes for solving a specific computational problem. They describe the steps you (or more usually your computer) must take to get from input to output and should guarantee you that if you follow the instructions exactly, you will (1) finish after a finite number of steps and (2) your output will be a solution to the problem they should solve, given the input you had.
3. Introduction to Algorithms
Get Introduction to Computational Thinking: Problem Solving, Algorithms, Data Structures, and More now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.