{"id":1831,"date":"2024-10-15T10:52:53","date_gmt":"2024-10-15T10:52:53","guid":{"rendered":"https:\/\/algocademy.com\/blog\/the-evolution-of-algorithms-through-computing-history\/"},"modified":"2026-10-15T10:34:48","modified_gmt":"2026-10-15T10:34:48","slug":"the-evolution-of-algorithms-through-computing-history","status":"publish","type":"post","link":"https:\/\/algocademy.com\/blog\/the-evolution-of-algorithms-through-computing-history\/","title":{"rendered":"The Evolution of Algorithms Through Computing History"},"content":{"rendered":"<p>Algorithms are older than computers by about two thousand years. The sequence of ideas runs from arithmetic procedures written on clay tablets and papyrus, through Ada Lovelace&#8217;s notes on a machine that was never finished, to the sorting, graph and cryptographic algorithms of the 1940s to 1970s, and then to large-scale data processing and machine learning. This post is a timeline of that path with dates that have been checked, and a note on why each step still matters to programmers today.<\/p>\n<h2>Before computers: procedures people ran by hand<\/h2>\n<p>The word <em>algorithm<\/em> comes from the name of Muhammad ibn Musa al-Khwarizmi, a scholar working in Baghdad in the early 9th century, whose book on calculation with Hindu-Arabic numerals was translated into Latin and spread those methods through Europe. The oldest well-documented procedures are far older:<\/p>\n<ul>\n<li><strong>Babylonian square roots (about 1800 to 1600 BCE).<\/strong> Clay tablets show good approximations of the square root of 2. The standard iterative method for square roots is often called Babylonian or Heron&#8217;s method: repeatedly average a guess with <code>n \/ guess<\/code>.<\/li>\n<li><strong>Euclid&#8217;s algorithm (about 300 BCE).<\/strong> Find the greatest common divisor by replacing a pair with the smaller number and the remainder.<\/li>\n<li><strong>The Sieve of Eratosthenes (3rd century BCE).<\/strong> List the primes up to n by crossing out multiples.<\/li>\n<\/ul>\n<p>Euclid&#8217;s method and the sieve are still taught, and still used as building blocks. Both fit in a few lines of Python:<\/p>\n<pre><code class=\"language-python\">def gcd(a, b):\n    while b:\n        a, b = b, a % b\n    return a\n\ndef sieve(n):\n    is_p = [False, False] + [True] * (n - 1)\n    for i in range(2, int(n ** 0.5) + 1):\n        if is_p[i]:\n            for j in range(i * i, n + 1, i):\n                is_p[j] = False\n    return [i for i, p in enumerate(is_p) if p]\n\nprint(gcd(1071, 462))  # 21\nprint(sieve(30))       # [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]<\/code><\/pre>\n<p>The sieve runs in roughly O(n log log n) time, and Euclid&#8217;s algorithm takes a number of steps proportional to the number of digits. Neither has been replaced in 2,000 years for its job. The Babylonian square-root method also survives: it is Newton&#8217;s method applied to <code>x\u00b2 = n<\/code>, and a handful of iterations gives about fifteen correct digits for 2 (1.414213562373095 after five).<\/p>\n<h2>The mechanical era: Babbage and Lovelace<\/h2>\n<p>In the 1830s Charles Babbage designed the Analytical Engine, a mechanical general-purpose computer with a store, an arithmetic unit and punched cards for instructions, an idea taken from the Jacquard loom. It was never completed. In 1843 Ada Lovelace published English notes on the engine that included, in the long Note G, a detailed method for computing Bernoulli numbers. It is often called the first published computer program. Because the machine did not exist, the program was never run on it; what matters is that it separated the procedure from the machine.<\/p>\n<h2>The electronic era: the first programs on real machines<\/h2>\n<ul>\n<li><strong>Z3 (1941).<\/strong> Konrad Zuse&#8217;s electromechanical machine was programmable and automatic, though it did not store its program in memory.<\/li>\n<li><strong>ENIAC (completed 1945, announced publicly in February 1946).<\/strong> A general-purpose electronic computer. At first it was reprogrammed by rewiring plugboards and setting switches, which took days. It ran a stored program only after a modification in 1948.<\/li>\n<li><strong>Merge sort (1945).<\/strong> John von Neumann devised it while working on stored-program designs. It is a divide and conquer algorithm that is still the basis of stable sorting in libraries; Python&#8217;s built-in <code>sorted<\/code> uses Timsort, a hybrid of merge sort and insertion sort.<\/li>\n<li><strong>Binary search (described in the 1940s).<\/strong> The idea is simple, but getting every edge case right took years: a version correct for all array lengths was published only in the early 1960s, and bugs in widely used implementations were found decades later. It is still a favourite interview topic for that reason.<\/li>\n<li><strong>Quicksort (developed 1959, published 1961).<\/strong> Tony Hoare designed it while working on machine translation. It sorts in place and is fast on average, with an O(n\u00b2) worst case that careful pivot choice makes unlikely.<\/li>\n<\/ul>\n<p>The first high-level languages (FORTRAN in 1957, LISP and ALGOL in 1958) let people write algorithms in something close to mathematical notation. ALGOL in particular was designed to describe algorithms, and its block structure influenced most later languages.<\/p>\n<h2>Graphs, data structures and storage (1950s to 1970s)<\/h2>\n<ul>\n<li><strong>Dijkstra&#8217;s shortest path algorithm.<\/strong> Conceived in 1956 and published in 1959. It is the basis of many routing systems.<\/li>\n<li><strong>A* search (1968).<\/strong> Hart, Nilsson and Raphael added a heuristic to guide the search, making pathfinding in games and robotics practical.<\/li>\n<li><strong>B-trees (1970).<\/strong> Rudolf Bayer and Edward McCreight at Boeing designed a balanced tree for data on disk, where reading one large block is much cheaper than many small ones. Variants of it still index most databases and file systems.<\/li>\n<li><strong>Dynamic programming and the study of complexity.<\/strong> Richard Bellman gave dynamic programming its name in the 1950s; the 1970s brought the formal study of NP-completeness. Together they gave programmers a vocabulary for &#8220;this is fast&#8221;, &#8220;this is hopeless&#8221;, and &#8220;this is hopeless but approximable&#8221;.<\/li>\n<\/ul>\n<h2>Cryptography: algorithms that need to stay hard<\/h2>\n<p>Until the 1970s, secret communication required sharing a key in advance. Public-key cryptography changed that: RSA (1977) lets anyone encrypt with a public key while only the owner can decrypt. DES became a US federal standard in January 1977 and was superseded by AES, published in 2001 and adopted as the replacement in 2002. The security of RSA depends on factoring large numbers being slow with known classical algorithms. Shor&#8217;s quantum algorithm (1994) would factor efficiently on a large enough quantum computer, but as of October 2026, demonstrations on real hardware have only factored very small numbers like 15 and 21, which is why standards bodies are moving to new post-quantum schemes as a precaution rather than because RSA is broken today.<\/p>\n<h2>Web scale and machine learning (1990s to now)<\/h2>\n<ul>\n<li><strong>PageRank (1996).<\/strong> Larry Page and Sergey Brin at Stanford ranked pages by the links pointing to them, treating the web as a graph.<\/li>\n<li><strong>MapReduce (2004).<\/strong> Jeffrey Dean and Sanjay Ghemawat at Google described a way to process huge datasets by splitting work across many machines. Google has since moved to other systems, but the model shaped open-source tools such as Hadoop and Spark.<\/li>\n<li><strong>Random forests (2001).<\/strong> Leo Breiman&#8217;s ensemble method, still a strong baseline for tabular data.<\/li>\n<li><strong>Neural networks and deep learning.<\/strong> Training with backpropagation dates from the 1980s; it became practical at scale in the 2010s with GPUs and large datasets. The transformer architecture (2017) underlies today&#8217;s large language models.<\/li>\n<\/ul>\n<p>The trend is visible: early algorithms were about exact answers on tiny machines; later ones trade exactness for scale (hashing, sketches, approximate nearest neighbours) or learn their behaviour from data.<\/p>\n<h2>What programmers should take from the history<\/h2>\n<ul>\n<li><strong>The classics last.<\/strong> Euclid, sieve, merge sort, binary search, Dijkstra and B-trees are in daily use, so the time you spend learning them does not go stale.<\/li>\n<li><strong>Hardware shapes algorithms.<\/strong> B-trees exist because disks are slow; MapReduce exists because one machine is too small; GPUs made deep learning feasible. When the hardware&#8217;s cost model changes, the best algorithm often changes with it.<\/li>\n<li><strong>Correctness is hard even for simple ideas.<\/strong> Binary search is the standard example.<\/li>\n<li><strong>Most progress is a better trade-off<\/strong>, not magic: memory for time, exactness for speed, a heuristic for a guarantee.<\/li>\n<\/ul>\n<p>If you want to try the techniques named here, the <a href=\"https:\/\/algocademy.com\/link\/?lang=py&amp;problem=merge-sort&amp;solution=1\">Merge Sort<\/a>, <a href=\"https:\/\/algocademy.com\/link\/?lang=py&amp;problem=binary-search&amp;solution=1\">Binary Search<\/a> and <a href=\"https:\/\/algocademy.com\/link\/?lang=py&amp;problem=quick-sort&amp;solution=1\">Quick Sort<\/a> lessons let you implement them step by step, and our post on <a href=\"https:\/\/algocademy.com\/blog\/an-introduction-to-algorithm-design-patterns\/\">algorithm design patterns<\/a> explains the strategies behind them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A dated timeline of algorithms, from Euclid and al-Khwarizmi to Babbage, early computers, sorting, graphs, cryptography and machine learning, with working code.<\/p>\n","protected":false},"author":1,"featured_media":1830,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-1831","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-problem-solving"],"_links":{"self":[{"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/posts\/1831"}],"collection":[{"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/comments?post=1831"}],"version-history":[{"count":1,"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/posts\/1831\/revisions"}],"predecessor-version":[{"id":8683,"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/posts\/1831\/revisions\/8683"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/media\/1830"}],"wp:attachment":[{"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/media?parent=1831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/categories?post=1831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/algocademy.com\/blog\/wp-json\/wp\/v2\/tags?post=1831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}