Algorithm: Difference between revisions

Content deleted Content added
No edit summary
Undid revision 1298501550 by 2.196.141.187 (talk) Editor seems to have misunderstood what ticker tape is
 
(114 intermediate revisions by 74 users not shown)
Line 1:
{{Short description|Sequence of operations for a task}}
{{Redirect|Algorithms|the subfield of computer science|Analysis of algorithms|other uses|Algorithm (disambiguation)}}
{{redirect|Algorythm|the album|Beyond Creation}}
{{Use mdy dates|date=September 2017}}{{Copyedit|date=April 2024}}
{{EssayUse mdy dates|date=AprilSeptember 20242017}}
[[File:GCD through successive subtractions.svg|thumb|Flowchart of using successive subtractions to find the [[greatest common divisor]] of number ''r'' and ''s''|alt=In a loop, subtract the larger number against the smaller number. Halt the loop when the subtraction will make a number negative. Assess two numbers, whether one of them is equal to zero or not. If yes, take the other number as the greatest common divisor. If no, put the two numbers in the subtraction loop again.]]
In [[mathematics]] and [[computer science]], an '''algorithm''' ({{IPAc-en|audio=en-us-algorithm.ogg|ˈ|æ|l|ɡ|ə|r|ɪ|ð|əm}}) is a [[mwod:finite|finite]] sequence of [[Rigour#Mathematics|mathematically rigorous]] instructions, typically used to solve a class of specific [[Computational problem|problem]]s or to perform a [[computation]].<ref name=":0">{{Cite web|url=https://www.merriam-webster.com/dictionary/algorithm|title=Definition of ALGORITHM|work=Merriam-Webster Online Dictionary |language=en |access-date=2019-11-14 |archive-url=https://web.archive.org/web/20200214074446/https://www.merriam-webster.com/dictionary/algorithm |archive-date=February 14, 2020|url-status=live}}</ref> Algorithms are used as specifications for performing [[calculation]]s and [[data processing]]. More advanced algorithms can use [[Conditional (computer programming)|conditional]]s to divert the code execution through various routes (referred to as [[automated decision-making]]) and deduce valid [[inference]]s (referred to as [[automated reasoning]]), achieving [[automation]] eventually. Using human characteristics as descriptors of machines in metaphorical ways was already practiced by [[Alan Turing]] with terms such as "memory", "search" and "stimulus".<ref name=":1">Blair, Ann, Duguid, Paul, Goeing, Anja-Silvia and Grafton, Anthony. Information: A Historical Companion, Princeton: Princeton University Press, 2021. p. 247</ref>
 
In contrast, a [[Heuristic (computer science) |heuristic]]] is an approach to problem-solving thatproblems may not be fully specified or may not guarantee correct or optimal results, especially in problem domains where there is nowithout well-defined correct or optimal resultresults.<ref name=":2">David A. Grossman, Ophir Frieder, ''Information Retrieval: Algorithms and Heuristics'', 2nd edition, 2004, {{isbn|1402030045}}</ref> For example, although social media [[recommender system]]s relyare oncommonly heuristics in such a way that, although widely characterized ascalled "algorithms", inthey 21st-centuryactually popularrely media,on cannotheuristics deliveras correctthere resultsis dueno totruly the nature of the"correct" problemrecommendation.
 
As an [[effective method]], an algorithm can be expressed within a finite amount of space and time<ref name=":3">"Any classical mathematical algorithm, for example, can be described in a finite number of English words" (Rogers 1987:2).</ref> and in a well-defined [[formal language]]<ref name=":4">Well defined concerning the agent that executes the algorithm: "There is a computing agent, usually human, which can react to the instructions and carry out the computations" (Rogers 1987:2).</ref> for calculating a [[Function (mathematics)|function]].<ref>"an algorithm is a procedure for computing a ''function'' (concerning some chosen notation for integers) ... this limitation (to numerical functions) results in no loss of generality", (Rogers 1987:1).</ref> Starting from an initial state and initial input (perhaps [[Empty string|empty]]),<ref>"An algorithm has [[zero]] or more inputs, i.e., [[Quantity|quantities]] which are given to it initially before the algorithm begins" (Knuth 1973:5).</ref> the instructions describe a computation that, when [[Execution (computing)|execute]]d, proceeds through a finite<ref>"A procedure which has all the characteristics of an algorithm except that it possibly lacks finiteness may be called a 'computational method{{'"}} (Knuth 1973:5).</ref> number of well-defined successive states, eventually producing "output"<ref>"An algorithm has one or more outputs, i.e., quantities which have a specified relation to the inputs" (Knuth 1973:5).</ref> and terminating at a final ending state. The transition from one state to the next is not necessarily [[deterministic]]; some algorithms, known as [[randomized algorithm]]s, incorporate random input.<ref>Whether or not a process with random interior processes (not including the input) is an algorithm is debatable. Rogers opines that: "a computation is carried out in a discrete stepwise fashion, without the use of continuous methods or analog devices ... carried forward deterministically, without resort to random methods or devices, e.g., dice" (Rogers 1987:2).</ref>
 
== Etymology ==
Around 825 AD, Persian scientist, and polymath [[Al-Khwarizmi|Muḥammad ibn Mūsā al-Khwārizmī]] wrote ''kitāb al-ḥisāb al-hindī'' ("Book of Indian computation") and ''kitab al-jam' wa'l-tafriq al-ḥisāb al-hindī'' ("Addition and subtraction in Indian arithmetic").<ref name=":0" /> In the early 12th century, Latin translations of said al-Khwarizmithese texts involving the [[Hindu–Arabic numeral system]] and [[arithmetic]] appeared, for example ''Liber Alghoarismi de practica arismetrice'', attributed to [[John of Seville]], and ''Liber Algorismi de numero Indorum'', attributed to [[Adelard of Bath]].<ref name=":1">Blair, Ann, Duguid, Paul, Goeing, Anja-Silvia and Grafton, Anthony. Information: A Historical Companion, Princeton: Princeton University Press, 2021. p. 247</ref> HerebyHere, ''alghoarismi'' or ''algorismi'' is the [[Latinisation of names|Latinization]] of Al-Khwarizmi's name;<ref name=":0" /> the text starts with the phrase ''Dixit Algorismi'', or "Thus spoke Al-Khwarizmi".<ref name=":2" /> Around 1230, the English word ''[[algorism]]'' is attested and then by [[Geoffrey Chaucer|Chaucer]] in 1391, English adopted the French term.<ref name=":3" /><ref name=":4" />{{Clarification needed|date=April 2024}} In the 15th century, under the influence of the Greek word ἀριθμός (''arithmos'', "number"; ''cf.'' "arithmetic"), the Latin word was altered to ''algorithmus''.{{Citation needed|date=April 2024}}
 
The word ''[[algorism]]'' in English came to mean the use of place-value notation in calculations; it occurs in the ''[[Ancrene Wisse]]'' from circa 1225.<ref>{{cite web|url=https://www.oed.com/dictionary/algorism_n?tl=true|title=algorism|work=Oxford English Dictionary|access-date=2025-05-18}}</ref> By the time [[Geoffrey Chaucer]] wrote ''[[The Canterbury Tales]]'' in the late 14th century, he used a variant of the same word in describing ''augrym stones'', stones used for place-value calculation.<ref>{{cite web|url=https://chaucer.fas.harvard.edu/pages/millers-prologue-and-tale|title=The Miller's Tale|at=Line 3210|first=Geoffrey|last=Chaucer}}</ref><ref>{{cite book|title=A Glossary of Tudor and Stuart Words: Especially from the Dramatists|editor-first=Anthony Lawson|editor-last=Mayhew|first=Walter William|last=Skeat|publisher=Clarendon Press|year=1914|contribution=agrim, agrum|pages=5–6|contribution-url=https://books.google.com/books?id=z58YAAAAIAAJ&pg=PA5}}</ref> In the 15th century, under the influence of the Greek word ἀριθμός (''arithmos'', "number"; ''cf.'' "arithmetic"), the Latin word was altered to ''algorithmus''.<ref>{{cite book
| last = Grabiner | first = Judith V. | author-link = Judith Grabiner
| editor-last = Matthews | editor-first = Michael R.
| contribution = The role of mathematics in liberal arts education
| date = December 2013
| doi = 10.1007/978-94-007-7654-8_25
| isbn = 9789400776548
| pages = 793–836
| publisher = Springer
| title = International Handbook of Research in History, Philosophy and Science Teaching}}</ref> By 1596, this form of the word was used in English, as ''algorithm'', by [[Thomas Hood (mathematician)|Thomas Hood]].<ref>{{cite web|url=https://www.oed.com/dictionary/algorithm_n|title=algorithm|work=Oxford English Dictionary|access-date=2025-05-18}}</ref>
 
== Definition ==
{{For|a detailed presentation of the various points of view on the definition of "algorithm"|Algorithm characterizations}}
 
One informal definition is "a set of rules that precisely defines a sequence of operations",<ref>Stone 1973:4</ref>{{request quotation sfnp| reason = Stone (1972) suggests on page 4: "...any sequence of instructions that a robot can obey, is called an algorithm"|date1971|p=July 20208}} which would include all [[computer program]]s (including programs that do not perform numeric calculations), and (for example) any prescribed [[bureaucratic]] procedure<ref>
{{cite book |last1=Simanowski |first1=Roberto |author-link1=Roberto Simanowski |url=https://books.google.com/books?id=RJV5DwAAQBAJ |title=The Death Algorithm and Other Digital Dilemmas |date=2018 |publisher=MIT Press |isbn=9780262536370 |series=Untimely Meditations |volume=14 |___location=Cambridge, Massachusetts |page=147 |translator1-last=Chase |translator1-first=Jefferson |quote=[...] the next level of abstraction of central bureaucracy: globally operating algorithms. |access-date=27 May 2019 |archive-url=https://web.archive.org/web/20191222120705/https://books.google.com/books?id=RJV5DwAAQBAJ |archive-date=December 22, 2019 |url-status=live}}
</ref>
or [[Cookbook|cook-book]] [[recipe]].<ref>
{{cite book |last1=Dietrich |first1=Eric |url=https://books.google.com/books?id=-wt1aZrGXLYC |title=The MIT Encyclopedia of the Cognitive Sciences |publisher=MIT Press |year=1999 |isbn=9780262731447 |editor1-last=Wilson |editor1-first=Robert Andrew |series=MIT Cognet library |___location=Cambridge, Massachusetts |publication-date=2001 |page=11 |chapter=Algorithm |quote=An algorithm is a recipe, method, or technique for doing something. |access-date=22 July 2020 |editor2-last=Keil |editor2-first=Frank C.}}
</ref> In general, a program is an algorithm only if it stops eventually<ref>Stone requires that "it must terminate in a finite number of steps" (Stone 1973:7–8).</ref>—even though [[infinite loop#Intentional looping|infinite loop]]s may sometimes prove desirable. {{Harvtxt|Boolos|Jeffrey|1974, 1999|ref=CITEREFBoolosJeffrey1999}} define an algorithm to be aan explicit set of instructions for determining an output, given explicitly, in a form that can be followed by either a computing machine or a human who could only carry out specific elementary operations on symbols''.''<ref>Boolos and Jeffrey 1974, 1999:19</ref>
 
The concept of ''algorithm'' is also used to define the notion of [[decidability (logic)|decidability]]—an idea that is central for explaining how [[formal system]]s come into being starting from a small set of [[axiom]]s and rules. In [[logic]], the time an algorithm requires to complete cannot be measured, as it is unrelated to the customary physical dimension. Such uncertainties that characterize ongoing work stem from the unavailability of a definition of ''algorithm'' that suits both concrete (in some sense) and abstract usage of the term.
 
Most algorithms are intended to be [[Implementation|implement]]ed as [[computer program]]s. However, algorithms are also implemented by other means, such as in a [[biological neural network]] (for example, the [[human brain]] implementingperforming [[arithmetic]] or an insect looking for food), in an [[electrical circuit]], or a mechanical device.
 
== History ==
Line 31 ⟶ 40:
 
=== Ancient algorithms ===
Since antiquity, stepStep-by-step procedures for solving mathematical problems have been attestedrecorded since antiquity. This includes in [[Babylonian mathematics]] (around 2500 BC),<ref name="Springer Science & Business Media">{{cite book |last1=Chabert |first1=Jean-Luc |title=A History of Algorithms: From the Pebble to the Microchip |date=2012 |publisher=Springer Science & Business Media |isbn=9783642181924 |pages=7–8}}</ref> [[Egyptian mathematics]] (around 1550 BC),<ref name="Springer Science & Business Media" /> [[Indian mathematics]] (around 800 BC and later),<ref name=":6">{{cite book |last1=Sriram |first1=M. S. |editor1-last=Emch |editor1-first=Gerard G. |editor2-last=Sridharan |editor2-first=R. |editor3-last=Srinivas |editor3-first=M. D. |title=Contributions to the History of Indian Mathematics |date=2005 |publisher=Springer |isbn=978-93-86279-25-5 |page=153 |chapter-url=https://books.google.com/books?id=qfJdDwAAQBAJ&pg=PA153 |language=en |chapter=Algorithms in Indian Mathematics}}</ref><ref>Hayashi, T. (2023, January 1). [https://www.britannica.com/biography/Brahmagupta Brahmagupta]. Encyclopedia Britannica.</ref> [the Ifa Oracle (around 500 BC),<ref>{{Cite journal |last=Zaslavsky |first=Claudia |date=1970 |title=Mathematics of the Yoruba People and of Their Neighbors in Southern Nigeria |url=https://www.jstor.org/stable/3027363 |journal=The IfaTwo-Year Oracle]College (aroundMathematics 500Journal BC),|volume=1 |issue=2 |pages=76–99 |doi=10.2307/3027363 |jstor=3027363 |issn=0049-4925|url-access=subscription }}</ref> [[Greek mathematics]] (around 240 BC),<ref name="Cooke2005">{{cite book|last=Cooke|first=Roger L.|title=The History of Mathematics: A Brief Course|date=2005|publisher=John Wiley & Sons|isbn=978-1-118-46029-0}}</ref> [[Chinese mathematics|Chinese mathematics (around 200 BC and later)]],<ref>{{Cite journal |date=1999 |editor-last=Chabert |editor-first=Jean-Luc |title=A History of Algorithms |url=https://link.springer.com/book/10.1007/978-3-642-18192-4 |journal=SpringerLink |language=en |doi=10.1007/978-3-642-18192-4|isbn=978-3-540-63369-3 |url-access=subscription }}</ref> and [[Arabic mathematics]] (around 800 AD).<ref name="Dooley">{{cite book |last1=Dooley |first1=John F. |title=A Brief History of Cryptology and Cryptographic Algorithms |date=2013 |publisher=Springer Science & Business Media |isbn=9783319016283 |pages=12–3}}</ref>
 
The earliest evidence of algorithms is found in the Babylonian mathematics of ancient [[Mesopotamia]]n (modern Iraq)mathematics. A [[Sumer]]ian clay tablet found in [[Shuruppak]] near [[Baghdad]] and dated to {{Circa|2500 BC}} describeddescribes the earliest [[division algorithm]].<ref name="Springer Science & Business Media" /> During the [[First Babylonian dynasty|Hammurabi dynasty]] {{Circa|1800|1600 BC|lk=no}}, [[Babylonia]]n clay tablets described algorithms for computing formulas.<ref>{{cite journal |last1=Knuth |first1=Donald E. |date=1972 |title=Ancient Babylonian Algorithms |url=http://steiner.math.nthu.edu.tw/disk5/js/computer/1.pdf |url-status=dead |journal=Commun. ACM |volume=15 |issue=7 |pages=671–677 |doi=10.1145/361454.361514 |issn=0001-0782 |s2cid=7829945 |archive-url=https://web.archive.org/web/20121224100137/http://steiner.math.nthu.edu.tw/disk5/js/computer/1.pdf |archive-date=2012-12-24}}</ref> Algorithms were also used in [[Babylonian astronomy]]. Babylonian clay tablets describe and employ algorithmic procedures to compute the time and place of significant astronomical events.<ref>{{cite book |last=Aaboe |first=Asger |author-link=Asger Aaboe |title=Episodes from the Early History of Astronomy |date=2001 |publisher=Springer |isbn=978-0-387-95136-2 |place=New York |pages=40–62}}</ref>
 
Algorithms for arithmetic are also found in ancient [[Egyptian mathematics]], dating back to the [[Rhind Mathematical Papyrus]] {{Circa|1550 BC|lk=no}}.<ref name="Springer Science & Business Media" /> Algorithms were later used in ancient [[Hellenistic mathematics]]. Two examples are the [[Sieve of Eratosthenes]], which was described in the ''[[Introduction to Arithmetic]]'' by [[Nicomachus]],<ref>{{cite web |last=Ast |first=Courtney |title=Eratosthenes |url=http://www.math.wichita.edu/history/men/eratosthenes.html |url-status=live |archive-url=https://web.archive.org/web/20150227150653/http://www.math.wichita.edu/history/men/eratosthenes.html |archive-date=February 27, 2015 |access-date=February 27, 2015 |publisher=Wichita State University: Department of Mathematics and Statistics}}</ref><ref name="Cooke2005" />{{rp|Ch 9.2}} and the [[Euclidean algorithm]], which was first described in ''[[Euclid's Elements]]'' ({{circa|300 BC|lk=no}}).<ref name="Cooke2005" />{{rp|Ch 9.1}}Examples of ancient Indian mathematics included the [[Shulba Sutras]], the [[Kerala school of astronomy and mathematics|Kerala School]], and the [[Brāhmasphuṭasiddhānta]].<ref name=":6" />
 
The first cryptographic algorithm for deciphering encrypted code was developed by [[Al-Kindi]], a 9th-century Arab mathematician, in ''A Manuscript On Deciphering Cryptographic Messages''. He gave the first description of [[cryptanalysis]] by [[frequency analysis]], the earliest codebreaking algorithm.<ref name="Dooley" />
Line 42 ⟶ 51:
 
==== Weight-driven clocks ====
Bolter credits the invention of the weight-driven clock as "Thethe key invention [of [[Europe in the middle ages|Europe in the Middle Ages]". In particular]]," he creditsspecifically the [[verge escapement]] mechanism<ref>Bolter 1984:24</ref> that provides us withproducing the tick and tock of a mechanical clock. "The accurate automatic machine"<ref>Bolter 1984:26</ref> led immediately to "mechanical [[automata theory|automata]]" beginning in the 13th century and finally to "computational machines"—the [[difference engine|difference]] and [[analytical enginesengine]]s of [[Charles Babbage]] and Countess [[Ada Lovelace]], in the mid-19th century.<ref>Bolter 1984:33–34, 204–206.</ref> Lovelace is credited withdesigned the first creation of an algorithm intended for processing on a computer—Babbagecomputer, Babbage's analytical engine, which is the first device considered a real [[Turing-complete]] computer instead of just a [[calculator]]—and. isAlthough sometimes called "history's first programmer" as a result, though athe full implementation of Babbage's second device wouldwas not be realized untilfor decades after her lifetime, Lovelace has been called "history's first programmer".
 
==== Electromechanical relay ====
Bell and Newell (1971) indicatewrite that the [[Jacquard loom]] (1801), a precursor to [[Hollerith card]]s (punch cards, 1887), and "telephone switching technologies" were the roots of a tree leadingled to the development of the first computers.<ref>Bell and Newell diagram 1971:39, cf. Davis 2000</ref> By the mid-19th century, the [[telegraph]], the precursor of the telephone, was in use throughout the world, its discrete and distinguishable encoding of letters as "dots and dashes" a common sound. By the late 19th century, the [[ticker tape]] ({{circa|1870s}}) was in use, as was the use ofwere Hollerith cards in the(c. 1890 U.S. census). Then came the [[teleprinter]] ({{circa|1910|lk=no}}) with its punched-paper use of [[Baudot code]] on tape.
 
Telephone-switching networks of [[relays|electromechanical relays]] (were invented in 1835). wasThese behindled to the workinvention of the digital adding device by [[George Stibitz]] (in 1937), the inventor of the digital adding device. As heWhile workedworking in Bell Laboratories, he observed the "burdensome'" use of mechanical calculators with gears. "He went home one evening in 1937 intending to test his idea... When the tinkering was over, Stibitz had constructed a binary adding device".<ref>Melina Hill, Valley News Correspondent, ''A Tinkerer Gets a Place in History'', Valley News West Lebanon NH, Thursday, March 31, 1983, p. 13.</ref> The mathematician [[Martin Davis (mathematician)|Martin Davi]]s supported the particular importance of the electromechanical relay.<ref>Davis 2000:14</ref>
 
=== Formalization ===
[[File:Diagram for the computation of Bernoulli numbers.jpg|thumb|[[Ada Lovelace]]'s diagram from "[[Note G]]", the first published computer algorithm]]
 
In 1928, a partial formalization of the modern concept of algorithms began with attempts to solve the ''[[Entscheidungsproblem]] ''(decision problem) posed by [[David Hilbert]]. Later formalizations were framed as attempts to define "[[effective calculability]]"<ref>Kleene 1943 in Davis 1965:274</ref> or "effective method".<ref>Rosser 1939 in Davis 1965:225</ref> Those formalizations included the [[Kurt Gödel|Gödel]]–[[Jacques Herbrand|Herbrand]]–[[Stephen Cole Kleene|Kleene]] recursive functions of 1930, 1934 and 1935, [[Alonzo Church]]'s [[lambda calculus]] of 1936, [[Emil Post]]'s [[Formulation 1]] of 1936, and [[Alan Turing]]'s [[turingTuring machines]] of 1936–37 and 1939.
 
==Representations==
Algorithms can be expressed in many kinds of notation, including [[natural languages]], [[pseudocode]], [[flowchart]]s, [[DRAKON|drakon-chart]]s, [[programming languages]] or [[control table]]s (processed by [[Interpreter (computing)|interpreter]]s). Natural language expressions of algorithms tend to be verbose and ambiguous and are rarely used for complex or technical algorithms. Pseudocode, flowcharts, drakon-charts, and control tables are structured waysexpressions to expressof algorithms that avoid many of thecommon ambiguities common in statements based onof natural language. Programming languages are primarily intended for expressing algorithms in a computer-executable form that can be executed by a computer, but they are also often used as a way to define or document algorithms.
 
=== Turing machines ===
There isare amany wide variety ofpossible representations possible and one can express a given [[Turing machine]] programprograms can be expressed as a sequence of machine tables (see [[finite-state machine]], [[state-transition table]], and [[control table]] for more), as flowcharts and drakon-charts (see [[state diagram]] for more), or as a form of rudimentary [[machine code]] or [[assembly code]] called "sets of quadruples", (see [[Turing machine]] forand more). RepresentationsAlgorithm of algorithmsrepresentations can also be classified into three accepted levels of Turing machine description: high-level description, implementation description, and formal description.<ref name=":5">Sipser 2006:157</ref> A high-level description describes the qualities of the algorithm itself, ignoring how it is implemented on the Turing machine.<ref name=":5" /> An implementation description describes the general manner in which the machine moves its head and stores data in order to carry out the algorithm, but does not give exact states.<ref name=":5" /> In the most detail, a formal description gives the exact state table and list of transitions of the Turing machine.<ref name=":5" />
 
=== Flowchart representation ===
The graphical aid called a [[flowchart]] offers a way to describe and document an algorithm (and a computer program corresponding to it). LikeIt thehas program flow of a Minsky machine, a flowchart always starts at the top of a page and proceeds down. Itsfour primary symbols are only four: the directed arrowarrows showing program flow, the rectanglerectangles (SEQUENCE, GOTO), the diamonddiamonds (IF-THEN-ELSE), and the dotdots (OR-tie). The Böhm–Jacopini canonical structures are made of these primitive shapes. Sub-structures can "nest" in rectangles, but only if a single exit occurs from the superstructure. The symbols and their use to build the canonical structures are shown in the diagram.''<ref>cf Tausworthe 1977</ref>''
 
== Algorithmic analysis ==
{{Main|Analysis of algorithms}}
 
It is frequentlyoften important to know how much of a particular resource (such as time or, storage), isor theoreticallyother requiredcost foran aalgorithm givenmay algorithmrequire. Methods have been developed for the analysis of algorithms to obtain such quantitative answers (estimates); for example, an algorithm that adds up the elements of a list of ''n'' numbers would have a time requirement of {{tmath|O(n)}}, using [[big O notation]]. At all times theThe algorithm only needs to remember two values: the sum of all the elements so far, and its current position in the input list. Therefore,If itthe isspace saidrequired to havestore the input numbers is not counted, it has a space requirement of {{tmath|O(1)}}, if the space required to store the input numbers is not counted, orotherwise {{tmath|O(n)}} if it is countedrequired.
 
Different algorithms may complete the same task with a different set of instructions in less or more time, space, or '[[algorithmic efficiency|effort]]' than others. For example, a [[binary search]] algorithm (with cost {{tmath|O(\log n)}}) outperforms a sequential search (cost {{tmath|O(n)}} ) when used for [[lookup table|table lookup]]s on sorted lists or arrays.
Line 73 ⟶ 82:
{{Main|Empirical algorithmics|Profiling (computer programming)|Program optimization}}
 
The [[analysis of algorithms|analysis, and study of algorithm]]s is a discipline of [[computer science]],. andAlgorithms isare often practicedstudied abstractly, without thereferencing use of aany specific [[programming language]] or implementation. In this sense, algorithmAlgorithm analysis resembles other mathematical disciplines in thatas it focuses on the underlyingalgorithm's properties of the algorithm and, not on the specifics of any particular implementation. Usually, [[pseudocodePseudocode]] is usedtypical for analysis as it is thea simplestsimple and most general representation. However, ultimately, mostMost algorithms are usually implemented on particular hardware/software platforms and their [[algorithmic efficiency]] is eventually put to the testtested using real code. For the solution of a "one-off" problem, theThe efficiency of a particular algorithm may notbe haveinsignificant significantfor consequencesmany (unless"one-off" nproblems isbut extremelyit large)may butbe critical for algorithms designed for fast interactive, commercial, or long -life scientific usage it may be critical. Scaling from small n to large n frequently exposes inefficient algorithms that are otherwise benign.
 
Empirical testing is useful becausefor it may uncoveruncovering unexpected interactions that affect performance. [[Benchmark (computing)|Benchmark]]s may be used to compare before/after potential improvements to an algorithm after program optimization.
Empirical tests cannot replace formal analysis, though, and are not non-trivial to perform in a fair mannerfairly.<ref name="KriegelSchubert2016">{{cite journal|last1=Kriegel|first1=Hans-Peter|author-link=Hans-Peter Kriegel|last2=Schubert|first2=Erich|last3=Zimek|first3=Arthur|author-link3=Arthur Zimek|title=The (black) art of run-time evaluation: Are we comparing algorithms or implementations?|journal=Knowledge and Information Systems|volume=52|issue=2|year=2016|pages=341–378|issn=0219-1377|doi=10.1007/s10115-016-1004-2|s2cid=40772241}}</ref>
 
=== Execution efficiency ===
Line 82 ⟶ 91:
 
To illustrate the potential improvements possible even in well-established algorithms, a recent significant innovation, relating to [[Fast Fourier transform|FFT]] algorithms (used heavily in the field of image processing), can decrease processing time up to 1,000 times for applications like medical imaging.<ref>{{cite web| title=Better Math Makes Faster Data Networks| author=Gillian Conahan| date=January 2013| url=http://discovermagazine.com/2013/jan-feb/34-better-math-makes-faster-data-networks| publisher=discovermagazine.com| access-date=May 13, 2014| archive-url=https://web.archive.org/web/20140513212427/http://discovermagazine.com/2013/jan-feb/34-better-math-makes-faster-data-networks| archive-date=May 13, 2014| url-status=live}}</ref> In general, speed improvements depend on special properties of the problem, which are very common in practical applications.<ref name="Hassanieh12">Haitham Hassanieh, [[Piotr Indyk]], Dina Katabi, and Eric Price, "[http://siam.omnibooksonline.com/2012SODA/data/papers/500.pdf ACM-SIAM Symposium On Discrete Algorithms (SODA)] {{webarchive|url=https://web.archive.org/web/20130704180806/http://siam.omnibooksonline.com/2012SODA/data/papers/500.pdf |date=July 4, 2013 }}, Kyoto, January 2012. See also the [http://groups.csail.mit.edu/netmit/sFFT/ sFFT Web Page] {{Webarchive|url=https://web.archive.org/web/20120221145740/http://groups.csail.mit.edu/netmit/sFFT/ |date=February 21, 2012 }}.</ref> Speedups of this magnitude enable computing devices that make extensive use of image processing (like digital cameras and medical equipment) to consume less power.
 
=== Best Case and Worst Case ===
{{Main|Best, worst and average case}}
The best case of an algorithm refers to the scenario or input for which the algorithm or data structure takes the least time and resources to complete its tasks.<ref>{{Cite web |title=Best Case |url=https://xlinux.nist.gov/dads/HTML/bestcase.html |access-date=29 May 2025 |website=Dictionary of Algorithms and Data Structures |publisher=National Institute of Standards and Technology (NIST) |agency=National Institute of Standards and Technology}}</ref> The worst case of an algorithm is the case that causes the algorithm or data structure to consume the maximum period of time and computational resources.<ref>{{Cite web |title=worst case |url=https://xlinux.nist.gov/dads/HTML/worstcase.html |access-date=29 May 2025 |website=Dictionary of Algorithms and Data Structures |publisher=National Institute of Standards and Technology (NIST) |agency=National Institute of Standards and Technology (NIST)}}</ref>
 
== Design ==
{{See also|Algorithm#By design paradigm}}
 
Algorithm design refers tois a method or a mathematical process for problem-solving and engineering algorithms. The design of algorithms is part of many solution theories, such as [[divide-and-conquer algorithm|divide-and-conquer]] or [[dynamic programming]] within [[operation research]]. Techniques for designing and implementing algorithm designs are also called algorithm design patterns,<ref>{{cite book |last1=Goodrich |first1=Michael T. |author1-link=Michael T. Goodrich |url=http://ww3.algorithmdesign.net/ch00-front.html |title=Algorithm Design: Foundations, Analysis, and Internet Examples |last2=Tamassia |first2=Roberto |author2-link=Roberto Tamassia |publisher=John Wiley & Sons, Inc. |year=2002 |isbn=978-0-471-38365-9 |access-date=June 14, 2018 |archive-url=https://web.archive.org/web/20150428201622/http://ww3.algorithmdesign.net/ch00-front.html |archive-date=April 28, 2015 |url-status=live}}</ref> with examples including the template method pattern and the decorator pattern. One of the most important aspects of algorithm design is resource (run-time, memory usage) efficiency; the [[big O notation]] is used to describe e.g., an algorithm's run-time growth as the size of its input increases.<ref>{{Cite web |title=Big-O notation (article) {{!}} Algorithms |url=https://www.khanacademy.org/computing/computer-science/algorithms/asymptotic-notation/a/big-o-notation |access-date=2024-06-03 |website=Khan Academy |language=en}}</ref>
 
=== Structured programming ===
Per the [[Church–Turing thesis]], any algorithm can be computed by a model known to beany [[Turing complete]] model. In fact, it has been demonstrated that Turing completeness only requires only four instruction types—conditional GOTO, unconditional GOTO, assignment, HALT. However, Kemeny and Kurtz observe that, while "undisciplined" use of unconditional GOTOs and conditional IF-THEN GOTOs can result in "[[spaghetti code]]", a programmer can write structured programs using only these instructions; on the other hand "it is also possible, and not too hard, to write badly structured programs in a structured language".<ref>[[John G. Kemeny]] and [[Thomas E. Kurtz]] 1985 ''Back to Basic: The History, Corruption, and Future of the Language'', Addison-Wesley Publishing Company, Inc. Reading, MA, {{ISBN|0-201-13433-0}}.</ref> Tausworthe augments the three [[Structured program theorem|Böhm-Jacopini canonical structures]]:<ref>Tausworthe 1977:101</ref> SEQUENCE, IF-THEN-ELSE, and WHILE-DO, with two more: DO-WHILE and CASE.<ref>Tausworthe 1977:142</ref> An additional benefit of a structured program is that it lends itself to [[proof of correctness|proofs of correctnes]]s using [[mathematical induction]].<ref>Knuth 1973 section 1.2.1, expanded by Tausworthe 1977 at pages 100ff and Chapter 9.1</ref>
 
== Legal status ==
{{see also|Software patent}}
 
Algorithms, byBy themselves, algorithms are not usually patentable. In the United States, a claim consisting solely of simple manipulations of abstract concepts, numbers, or signals does not constitute "processes" (USPTO 2006), so algorithms are not patentable (as in ''[[Gottschalk v. Benson]]''). However practical applications of algorithms are sometimes patentable. For example, in ''[[Diamond v. Diehr]]'', the application of a simple [[feedback]] algorithm to aid in the curing of [[synthetic rubber]] was deemed patentable. The [[Software patent debate|patenting of software]] is controversial,<ref>{{Cite news |date=2013-05-16 |title=The Experts: Does the Patent System Encourage Innovation? |url=https://www.wsj.com/articles/SB10001424127887323582904578487200821421958 |access-date=2017-03-29 |work=[[The Wall Street Journal]] |issn=0099-9660}}</ref> and there are criticized patents involving algorithms, especially [[data compression]] algorithms, such as [[Unisys]]'s [[Graphics Interchange Format#Unisys and LZW patent enforcement|LZW patent]]. Additionally, some cryptographic algorithms have export restrictions (see [[export of cryptography]]).
 
== Classification ==
There are various ways to classify algorithms, each with its own merits.
 
=== By implementation ===
One way to classify algorithms is by implementation means.
 
{| style="float:right; width:200pt;"
|-
|
<syntaxhighlight lang="C">
int gcd(int A, int B) {
if (B == 0)
return A;
else if (A > B)
return gcd(A-B,B);
else
return gcd(A,B-A);
}
</syntaxhighlight>
|-
| Recursive [[C (programming language)|C]] implementation of Euclid's algorithm from the [[#lead|above]] flowchart
|}
 
; Recursion
: A [[recursive algorithm]] is one that invokes (makes reference to) itself repeatedly until meeting a certain condition (also known as termination condition) matches, whichand is a method common to [[functional programming]] method. [[Iteration|Iterative]] algorithms use repetitiverepetitions constructssuch likeas [[Program loops|loop]]s and sometimes additionalor data structures like [[Stack (data structure)|stack]]s to solve the given problems. SomeProblems problemsmay are naturallybe suited for one implementation or the other. For example,The [[towersTower of Hanoi]] is wella puzzle commonly understoodsolved using recursive implementation. Every recursive version has an equivalent (but possibly more or less complex) iterative version, and vice versa.
; Serial, parallel or distributed
: Algorithms are usually discussed with the assumption that computers execute one instruction of an algorithm at a time. Those computers are sometimes calledon serial computers. AnSerial [[algorithmalgorithms design]]edare designed for suchthese an environment is called a serial algorithmenvironments, as opposed tounlike [[parallel algorithm|parallel]]s or [[distributed algorithm|distributed]]s algorithms. Parallel algorithms are algorithms that take advantage of computer architectures where multiple processors can work on a problem at the same time. Distributed algorithms are algorithms that use multiple machines connected tovia a computer network. Parallel and distributed algorithms divide the problem into more symmetrical or asymmetrical subproblems and collect the results back together. For example, a CPU would be an example of a parallel algorithm. The resourceResource consumption in suchthese algorithms is not only processor cycles on each processor but also the communication overhead between the processors. Some sorting algorithms can be parallelized efficiently, but their communication overhead is expensive. Iterative algorithms are generally parallelizable, but some problems have no parallel algorithms and are called inherently serial problems.
; Deterministic or non-deterministic
: [[Deterministic algorithm]]s solve the problem with exact decisiondecisions at every step of the algorithm; whereas [[non-deterministic algorithm]]s solve problems via guessing. althoughGuesses typicalare guesses aretypically made more accurate through the use of [[heuristics]].
; Exact or approximate
: While many algorithms reach an exact solution, [[approximation algorithm]]s seek an approximation that is closerclose to the true solution. The approximation can be reached by either using a deterministic or a random strategy. Such algorithms have practical value for many hard problems. OneFor of the examples of an approximate algorithm isexample, the [[Knapsack problem]], where there is a set of given items., Itsand the goal is to pack the knapsack to get the maximum total value. Each item has some weight and some value. The total weight that can be carried is no more than some fixed number X. So, the solution must consider the weights of items as well as their value.<ref>{{Cite book|url=https://www.springer.com/us/book/9783540402862|title=Knapsack Problems {{!}} Hans Kellerer {{!}} Springer|language=en|isbn=978-3-540-40286-2|publisher=Springer|year=2004|doi=10.1007/978-3-540-24777-7|access-date=September 19, 2017|archive-url=https://web.archive.org/web/20171018181055/https://www.springer.com/us/book/9783540402862|archive-date=October 18, 2017|url-status=live|last1=Kellerer|first1=Hans|last2=Pferschy|first2=Ulrich|last3=Pisinger|first3=David|s2cid=28836720 }}</ref>
; Quantum algorithm
: [[Quantum algorithm]]s run on a realistic model of [[quantum computation]]. The term is usually used for those algorithms whichthat seem inherently quantum or use some essential feature of [[Quantum computing]] such as [[quantum superposition]] or [[quantum entanglement]].
 
=== By design paradigm ===
Another way of classifying algorithms is by their design methodology or [[algorithmic paradigm|paradigm]]. There is a certain number of paradigms, each different from the other. Furthermore, each of these categories includes many different types of algorithms. Some common paradigms are:
 
; [[Brute-force search|Brute-force]] or exhaustive search
: Brute force is a method of problem-solving thatmethod involvesof systematically trying every possible option until the optimal solution is found. This approach can be very time-consuming, as it requires going throughtesting every possible combination of variables. However, itIt is often used when other methods are not availableunavailable or too complex. Brute force can be used to solve a variety of problems, including finding the shortest path between two points and cracking passwords.
; Divide and conquer
: A [[divide-and-conquer algorithm]] repeatedly reduces an instance of a problem to one or more smaller instances of the same problemitself (usually [[recursion|recursively]]) until the instances are small enough to solve easily. One[[mergesort|Merge suchsorting]] is an example of divide and conquer, iswhere [[mergesort|mergean sorting]].unordered Sortinglist canis berepeatedly donesplit oninto eachsmaller segmentlists, ofwhich dataare aftersorted dividingin datathe intosame segmentsway and sortingthen ofmerged.<ref>{{cite entirebook|title=Algorithm dataDesign: canFoundations, beAnalysis, obtainedand inInternet theExamples|first1=Michael conquerT.|last1=Goodrich|first2=Roberto|last2=Tamassia|publisher=John phaseWiley by& mergingSons|year=2001|isbn=9780471383659|contribution=5.2 theDivide segments.and AConquer|page=263}}</ref> In a simpler variant of divide and conquer is called a[[prune and search]] or ''decrease-and-conquer algorithm'', which solves anone identicalsmaller subproblem and uses the solutioninstance of this subproblem to solve the bigger problem. Divideitself, and conquerdoes dividesnot therequire problema intomerge multiple subproblemsstep.{{sfnp|Goodrich|Tamassia|2001|loc=4.7.1 Prune-and so the conquer stage is more complex than decrease and conquer algorithms.-search|p=245}} An example of a decreaseprune and conquersearch algorithm is the [[binary search algorithm]].
; Search and enumeration
: Many problems (such as playing [[Chess|ches]]s) can be modeledmodelled as problems on [[graph theory|graph]]s. A [[graph exploration algorithm]] specifies rules for moving around a graph and is useful for such problems. This category also includes [[search algorithm]]s, [[branch and bound]] enumeration, and [[backtracking]].
;[[Randomized algorithm]]
: Such algorithms make some choices randomly (or pseudo-randomly). They can be very useful in findingfind approximate solutions for problems wherewhen finding exact solutions canmay be impractical (see heuristic method below). For some of these problems, it is known that the fastest approximations must involve some [[randomness]].<ref>For instance, the [[volume]] of a [[convex polytope]] (described using a membership oracle) can be approximated to high accuracy by a randomized polynomial time algorithm, but not by a deterministic one: see {{cite journal
| last1 = Dyer | first1 = Martin
| last2 = Frieze | first2 = Alan
Line 155 ⟶ 147:
# [[Las Vegas algorithm]]s always return the correct answer, but their running time is only probabilistically bound, e.g. [[Zero-error Probabilistic Polynomial time|ZPP]].
; [[Reduction (complexity)|Reduction of complexity]]
: This technique involves solving atransforms difficult problem by transforming itproblems into a better-known problem for whichproblems wesolvable havewith (hopefully) [[asymptotically optimal]] algorithms. The goal is to find a reducing algorithm whose [[Computational complexity theory|complexity]] is not dominated by the resulting reduced algorithms. For example, one [[selection algorithm]] for findingfinds the median inof an unsorted list involvesby first sorting the list (the expensive portion), and then pulling out the middle element in the sorted list (the cheap portion). This technique is also known as ''[[Transform and conquer algorithm|transform and conquer]]''.
; [[Back tracking]]
: In this approach, multiple solutions are built incrementally and abandoned when it is determined that they cannot lead to a valid full solution.
Line 163 ⟶ 155:
 
; [[Linear programming]]
: When searching for optimal solutions to a linear function bound toby linear equality and inequality constraints, the constraints of the problem can be used directly into producing theproduce optimal solutions. There are algorithms that can solve any problem in this category, such as the popular [[simplex algorithm]].<ref>
[[George B. Dantzig]] and Mukund N. Thapa. 2003. ''Linear Programming 2: Theory and Extensions''. Springer-Verlag.</ref> Problems that can be solved with linear programming include the [[maximum flow problem]] for directed graphs. If a problem additionallyalso requires that one or moreany of the unknowns must be an [[integer]]s, then it is classified in [[integer programming]]. A linear programming algorithm can solve such a problem if it can be proved that all restrictions for integer values are superficial, i.e., the solutions satisfy these restrictions anyway. In the general case, a specialized algorithm or an algorithm that finds approximate solutions is used, depending on the difficulty of the problem.
; [[Dynamic programming]]
: When a problem shows optimal substructures—meaning the optimal solution to a problem can be constructed from optimal solutions to subproblems—and [[overlapping subproblem]]s, meaning the same subproblems are used to solve many different problem instances, a quicker approach called ''dynamic programming'' avoids recomputing solutions that have already been computed. For example, [[Floyd–Warshall algorithm]], the shortest path tobetween a goalstart fromand agoal vertex in a weighted [[graph (discrete mathematics)|graph]] can be found by using the shortest path to the goal from all adjacent vertices. Dynamic programming and [[memoization]] go together. The main difference between dynamic programming andUnlike divide and conquer, isdynamic thatprogramming subproblems are more or less independent in divide and conquer, whereas subproblemsoften overlap in dynamic programming. The difference between dynamic programming and straightforwardsimple recursion is inthe caching or memoization of recursive calls. When subproblems are independent and theredo is nonot repetitionrepeat, memoization does not help; hence dynamic programming is not aapplicable solution forto all complex problems. By usingUsing memoization or maintaining a [[Mathematical table|table]] of subproblems already solved, dynamic programming reduces the exponential naturecomplexity of many problems from exponential to polynomial complexity.
; The greedy method
: A [[greedyGreedy algorithm]]s, is similarsimilarly to a dynamic programming, algorithm in that it workswork by examining substructures, in this case not of the problem but of a given solution. Such algorithms start with some solution, which may be given or have been constructed in some way and improve it by making small modifications. For some problems, they canalways find the optimal solution whilebut for others they may stop at [[local optimum|local optima]], that is, at solutions that cannot be improved by the algorithm but are not optimum. The most popular use of greedy algorithms is for finding the minimal spanning treetrees whereof findinggraphs thewithout optimal solution is possible with thisnegative methodcycles. [[Huffman coding|Huffman Tree]], [[kruskal's algorithm|Kruskal]], [[Prim's algorithm|Prim]], [[Sollin's algorithm|Sollin]] are greedy algorithms that can solve this optimization problem.
;The heuristic method
:In [[optimization problem]]s, [[heuristic algorithm]]s can be used to find a solutionsolutions close to the optimal solution in cases wherewhen finding the optimal solution is impractical. These algorithms work by gettingget closer and closer to the optimal solution as they progress. In principle, if run for an infinite amount of time, they will find the optimal solution. TheirThey meritcan is that they canideally find a solution very close to the optimal solution in a relatively short time. SuchThese algorithms include [[local search (optimization)|local search]], [[tabu search]], [[simulated annealing]], and [[genetic algorithm]]s. Some of them, like simulated annealing, are non-deterministic algorithms while others, like tabu search, are deterministic. When a bound on the error of the non-optimal solution is known, the algorithm is further categorized as an [[approximation algorithm]].
 
== Examples ==
{{Further|List of algorithms}}
 
One of the simplest algorithms is to findfinds the largest number in a list of numbers of random order. Finding the solution requires looking at every number in the list. From this follows a simple algorithm, which can be stateddescribed in a high-level description inplain English prose, as:
 
''High-level description:''
# If therea areset noof numbers inis the setempty, then there is no highest number.
# Assume the first number in the set is the largest number in the set.
# For each remaining number in the set: if this number is largergreater than the current largest number, considerit thisbecomes numberthe to be thenew largest number in the set.
# When there are no unchecked numbers left in the set to iterate over, consider the current largest number to be the largest number ofin the set.
 
''(Quasi-)formal description:''
Line 203 ⟶ 195:
* [[Abstract machine]]
* [[ALGOL]]
* [[Logic programming#Algorithm = Logic + Control|Algorithm = Logic + Control]]
* [[Algorithm aversion]]
* [[Algorithm engineering]]
Line 212 ⟶ 205:
* [[Algorithmic technique]]
* [[Algorithmic topology]]
* [[Computational mathematics]]
* [[Garbage in, garbage out]]
* ''[[Introduction to Algorithms]]'' (textbook)
Line 217 ⟶ 211:
* [[List of algorithms]]
* [[List of algorithm general topics]]
* [[Medium is the message]]
* [[Regulation of algorithms]]
* [[Theory of computation]]
** [[Computability theory]]
** [[Computational complexity theory]]
* [[Computational mathematics]]
{{div col end}}
 
Line 264 ⟶ 258:
* {{cite book| last = Sipser| first = Michael| title = Introduction to the Theory of Computation| year = 2006| publisher = PWS Publishing Company| isbn = 978-0-534-94728-6| url = https://archive.org/details/introductiontoth00sips}}
* {{cite book |last1=Sober |first1=Elliott |last2=Wilson |first2=David Sloan |year=1998 |title=Unto Others: The Evolution and Psychology of Unselfish Behavior |url=https://archive.org/details/untoothersevolut00sobe |url-access=registration |___location=Cambridge |publisher=Harvard University Press|isbn=9780674930469 }}
* {{Cite book|last=Stone|first=Harold S.|title=Introduction to Computer Organization and Data Structures|edition=1972|publisher=McGraw-Hill, New York|isbn=978-0-07-061726-19780070617261|year=19721971}} Cf. in particular the first chapter titled: ''Algorithms, Turing Machines, and Programs''. His succinct informal definition: "...any sequence of instructions that can be obeyed by a robot, is called an ''algorithm''" (p.&nbsp;4).
* {{cite book| last = Tausworthe| first = Robert C| title = Standardized Development of Computer Software Part 1 Methods| year = 1977| publisher = Prentice–Hall, Inc.| ___location = Englewood Cliffs NJ| isbn = 978-0-13-842195-3 }}
* {{Cite journal|last=Turing|first=Alan M.|author-link=A. M. Turing|title=On Computable Numbers, With An Application to the Entscheidungsproblem|journal=[[Proceedings of the London Mathematical Society]]|series=Series 2|volume=42|pages= 230–265 |year=1936–37|doi=10.1112/plms/s2-42.1.230 |s2cid=73712 }}. Corrections, ibid, vol. 43(1937) pp.&nbsp;544–546. Reprinted in ''The Undecidable'', p.&nbsp;116ff. Turing's famous paper completed as a Master's dissertation while at King's College Cambridge UK.
Line 280 ⟶ 274:
* {{cite book |author=Harel, David |author2=Feldman, Yishai |title=Algorithmics: The Spirit of Computing |year=2004 |publisher=Addison-Wesley |isbn=978-0-321-11784-7}}
* {{cite book |last1=Hertzke |first1=Allen D. |last2=McRorie |first2=Chris |year=1998 |editor1-last=Lawler |editor1-first=Peter Augustine |editor2-last=McConkey |editor2-first=Dale |chapter=The Concept of Moral Ecology |title=Community and Political Thought Today |___location=Westport, CT |publisher=[[Praeger Publishers|Praeger]] }}
* Jon Kleinberg, Éva Tardos(2006): ''Algorithm Design'', Pearson/Addison-Wesley, ISBN 978-0-32129535-4
* [[Donald Knuth|Knuth, Donald E.]] (2000). ''[http://www-cs-faculty.stanford.edu/~uno/aa.html Selected Papers on Analysis of Algorithms] {{Webarchive|url=https://web.archive.org/web/20170701190647/http://www-cs-faculty.stanford.edu/~uno/aa.html |date=July 1, 2017 }}''. Stanford, California: Center for the Study of Language and Information.
* Knuth, Donald E. (2010). ''[http://www-cs-faculty.stanford.edu/~uno/da.html Selected Papers on Design of Algorithms] {{Webarchive|url=https://web.archive.org/web/20170716225848/http://www-cs-faculty.stanford.edu/~uno/da.html |date=July 16, 2017 }}''. Stanford, California: Center for the Study of Language and Information.
Line 290 ⟶ 285:
{{wikibooks|Algorithms}}
{{Wikiversity department}}
{{Commons category|Algorithms}}
* {{springer|title=Algorithm|id=p/a011780|mode=cs1}}
* {{curlie|Computers/Algorithms/|Algorithms}}
* {{MathWorld | urlname=Algorithm | title=Algorithm}}
* [https://www.nist.gov/dads/ Dictionary of Algorithms and Data Structures] – [[National Institute of Standards and Technology]]
Line 303 ⟶ 297:
{{Algorithmic paradigms}}
{{Authority control}}
 
[[Category:Algorithms| ]]
[[Category:Articles with example pseudocode]]