Dr. Abhishek Dutta

“The Book” of Computer Algorithms

In this page, I collect all the computer algorithms that I find worthy of inclusion in “The Book “.

The Mathematician Paul Erdős often spoke of THE BOOK, a legendary column (not to be found on the shelves of any earthly library) in which are inscribed the best possible proofs of all mathematical theorems. Perhaps there is also a Book for programs and algorithms, listing the best solution to every computational problems. To earn a place in those pages, a program must be more than just correct; it must also be lucid, elegant, concise, even witty. — Brian Hayes (Chapter 33: Writing Programs for “The Book”)

The contents in this page will be reorganized into categories as I progress with my understanding of these algorithms. For now, I just list then in the order I encountered them.

  • Collinearity of three points in a plane

Collinearity of three points in a plane

  • If three points lie in a line, they form a degenerate triangle whose  area is 0
  • From the three given points, create two vectors emanating from same point.
  • Imagine that these two vectors are the adjacent edges of a parallelogram, then the area of parallelogram is equal the vector cross product of the two adjacent edges.
  • The diagonal of this parallelogram divides it into two triangles whose area is equal to the area of triangle formed by the three given points.
  • Source: An excellent story on how Brian Hayes  stumbled on this algorithm is presented in Chapter 33: Writing Programs for “The Book” of this book.

Last Updated: 08 April 2017

Written by abhishekdutta

April 8, 2017 at 8:13 pm