Classifications of Algorithms | DSA Tutorials YASH PAL, 5 May 20265 May 2026 Algorithms are classified by purpose, but there are other ways to classify themClassification by purposeClassification by implementationBy design paradigmBy complexityClassifications of AlgorithmsAn algorithm can be specified in any language. It can be specified in a natural language like English or as a computer language, or even as a hardware design. But the specifications must make sure that the resulting instructions are definite and provide a detailed description of the computational procedure to be followed.Classification by PurposeEach algorithm has a goal; for example, the purpose of the Quick Sort algorithm is to sort data in ascending or descending order. But the number of goals is infinite, and we have to group them by kind of purpose: Algorithms and source code.Classification by ImplementationAn algorithm may be implemented according to different basic principles.Deterministic or non-Deterministic: Deterministic algorithms solve the problem with a predefined process, whereas non-deterministic algorithms must perform guesses of the best solution at each step through the use of heuristics.Recursive or Iterative: A recursive algorithm calls itself repeatedly until a certain condition is met. It is a method common to functional programming. Iterative algorithms use repetitive constructs like loops. Some problems are better suited for one implementation or the other. For example, the Towers of Hanoi problem is well understood in recursive implementation. Every recursive version has an iterative equivalent, and vice versa.Logical or Procedural: An algorithm may be viewed as controlled logical deduction. A logic component expresses the axioms, which may be used in the computation, and a control component determines the way in which deduction is applied to the axioms. This is the basis of logical programming. In pure logic programming languages, the control component is fixed, and algorithms are specified by supplying only the logic component.Serial or Parallel: Algorithms are usually discussed with the assumption that computers execute one instruction of an algorithm at a time. This is a serial algorithm, as opposed to parallel algorithms, which take advantage of computer architectures to process several instructions at once. They divide the problem into sub-problems and pass them to several processors. Iterative algorithms are generally parallelizable. Sorting algorithms can be parallelised efficiently.Classification by Design ParadigmA design paradigm is a domain in research or a class of problems that requires a dedicated kind of algorithm:Divide and Conquer: A divide and conquer algorithm is based on multi-branched recursion that repeatedly reduces an instance of a problem to one or more smaller instances of the same problem (usually recursively), until the instances are small enough to solve easily. One such example of divide and conquer is merge sorting. Sorting can be done on each segment of data after dividing the data into segments, and sorting of the entire data can be obtained in the conquer phase by merging them. The binary search algorithm is an example of a variant of divide and conquer called the decrease and conquer algorithm, which solves an identical subproblem and uses the solution of this subproblem to solve the bigger problem.Dynamic Programming: The shortest path in a weighted graph can be found by using the shortest path to the goal from all adjacent vertices. When the optimal solution to a problem can be constructed from optimal solutions to subproblems, using dynamic programming avoids recomputing solutions that have already been computed. The main difference with the “divide and conquer” approach is that subproblems are independent in divide and conquer, whereas the overlap of subproblems occurs in dynamic programming.The Greedy Method: A greedy algorithm is similar to a dynamic programming algorithm, but the difference is that solutions to the subproblems do not have to be known at each stage. Instead, a “greedy” choice can be made of what looks like the best solution for the moment. The most popular greedy algorithm is finding the minimal spanning tree, as given by Kruskal.Linear Programming: The problem is expressed as a set of linear inequalities, and then an attempt is made to maximise or minimise the inputs. This can solve many problems, such as the maximum flow for directed graphs, notably by using the simplex algorithm. A complex variant of linear programming is called integer programming, where the solution space is restricted to all integers.Reduction is also called Transform and Conquer: Solve a problem by transforming it into another problem. A simple example: finding the median in an unsorted list is first translating this problem into a sorting problem and finding the middle element in a sorted list. The main goal of reduction is finding the simplest possible transformation.Using Graphs: Many problems, such as playing chess, can be modelled as problems on graphs. A graph exploration algorithm is used. This category also includes the search algorithms and backtracking.The Probabilistic and Heuristic ParadigmProbabilistic: Those that make some choices randomly.Genetic: Attempt to find solutions to problems by mimicking biological evolutionary processes, with a cycle of random mutations yielding successive generations of “solutions”. Thus, they emulate reproduction and “survival of the fittest”.Heuristic: whose general purpose is not to find an optimal solution, but an approximate solution where the time or resources to find a perfect solution are not practical.Classification by ComplexitySome algorithms complete in linear time, some complete in an exponential amount of time, and some never complete.Data Structures & Algorithms Tutorials for Beginners Data Structures Tutorials DSA Tutorials