Fundamentals of Computer Algorithms: A Comprehensive Guide

In this article we will discuss the book Fundamentals of Computer Algorithms by Horowitz and Sahni. This book covers:

  • How to devise and analyze new algorithms?
  • How to devise good algorithms?
  • Design Techniques

A knowledge of design is needed to create good algorithms. Tools of analysis provides a way to determine the quality of the result.

Fundamental Strategies of Algorithm Design

The number of basic design strategies is small. All the algorithms you wish to study can easily fit into these categories. For example, mergesort and quicksort are examples of the divide-and-conquer strategy while Kruskal’s minimum spanning tree algorithm and Dijkstra’s single source shortest path algorithm are straightforward examples of the greedy strategy.


An understanding of these strategies is an essential first step towards acquiring the skills of design. However there is no cookbook approach to algorithm design by assuming that each algorithm must derive from only a single technique.

First each strategy is described in general terms. A program template is given which outlines the form that the computation will take if this strategy can be applied.

The basic design techniques are:

  • Divide and Conquer
  • The Greedy Method
  • Dynamic Programming
  • Search and Traversal
  • Backtracking
  • Branch and Bound

For each problem we emphasize how the solution can be arrived at by considering a design principle and showing that it applies. Perhaps alternative strategies are investigated and discarded.

A clean separation is made between how the computation will proceed and decisions about data representation when that is possible. The best case and the worst case data of the resulting algorithm is made clear. Then an analysis of the time and space requirements is done.

How to Devise Algorithms

The act of creating an algorithm is an art which may never be fully automated. This book provides various design techniques which have proven to be useful in that they have often yielded good algorithms. By mastering these design strategies, it will become easier for you to devise new and useful algorithms.

This book is organized around the major methods of algorithm design. It gives an introduction to many approaches to algorithm formulation.

How to Express Algorithms

The structured programming is about the clear and concise expression of algorithms in a programming language. Good books on these topics are:

  • Structured Programming by Dahl, Dijkstra and Hoare (Academic Press)
  • The Elements of Programming Style by Kernighan and Plauger (McGraw Hill)

The process of reading a well composed program will improve your own skills.

How to Analyze Algorithms

This field of study is called analysis of algorithms. An as algorithm is executed, it makes use of the computer’s CPU to perform operations and it uses the memory (both immediate and auxiliary) to hold the program and its data.

Analysis of Algorithms refers to the process of determining how much computing time and storage an algorithm will require. We can predict if our software will meet any efficiency constraints. We can compare the value of one algorithm over another.

The book “Fundamentals of Computer Algorithms” by Horowitz and Sahni is a significant work in the field of computer science. It provides comprehensive coverage of a wide range of topics related to algorithm design and analysis.

Devising and Analyzing New Algorithms

The book presents comprehensive insights on how to devise new and effective algorithms. Devising a new algorithm is not simply about creating a solution, but rather about creating the most efficient solution possible. This process involves a deep understanding of problem-solving methodologies and algorithm design techniques.

The book also discusses how to analyze algorithms, which is a critical aspect of algorithm design. Analyzing an algorithm involves determining its efficiency in terms of time and space complexity. This enables a clear understanding of the algorithm’s performance characteristics, which in turn allows for informed comparisons between different algorithms.

Design Techniques

Algorithm design involves various techniques that aim to optimize the solution to a problem. This book presents several design techniques and provides examples of problems that can be solved using these techniques. Here are the major design techniques discussed in the book:

  1. Divide and Conquer: This strategy involves breaking a problem down into smaller, more manageable subproblems until these subproblems become simple enough to be solved directly. The solutions to the subproblems are then combined to give a solution to the original problem.

  2. The Greedy Method: This involves making the locally optimal choice at each stage with the hope that these local choices will lead to a global optimum.

  3. Dynamic Programming: This approach involves breaking down a complex problem into simpler, overlapping subproblems, solving each of those subproblems just once, and storing their solutions - ideally in a tabular format - to avoid duplicate work.

  4. Search and Traversal: These techniques are used to visit nodes of a data structure, such as trees or graphs.

  5. Backtracking: This is a systematic way of searching through all possible configurations of a problem until a solution is found.

  6. Branch and Bound: This strategy is used for solving optimization problems. It involves partitioning the problem into subproblems and optimally solving these subproblems to reach the optimal solution of the original problem.

Expressing Algorithms

The book also emphasizes the importance of expressing algorithms in a clear and concise manner, often through structured programming. Structured programming is a programming paradigm that increases the clarity and quality of code by allowing control flow to be expressed in a hierarchical manner, minimizing the use of control flow mechanisms such as GOTO statements.

Algorithm Analysis

Analysis of algorithms is a field of study that focuses on the performance of algorithms. When we analyze an algorithm, we are interested in determining the amount of computing resources, such as time and memory, that an algorithm uses as a function of the size of its input.

This analysis allows us to predict whether a given algorithm will meet the efficiency requirements of a particular application, and it also lets us compare different algorithms to determine which one is the most efficient.

To sum up, “Fundamentals of Computer Algorithms” by Horowitz and Sahni provides a solid foundation for understanding, designing, and analyzing computer algorithms. This book is essential for anyone studying computer science or working in a field where efficient problem-solving is necessary.