Improving an Algorithm

Learn to optimize an algorithm with programming constructs.

Understanding algorithms from mathematics to computation

Algorithms are one of the main branches of computer science and discrete mathematics. This is why we use concepts and notations from discrete mathematics in computational algorithms. We can map any problem from mathematical form to a computer program with the help of the same algorithm.

Let’s plunge into code to understand how we can map our problems from the mathematical domain to our computational field. Let’s start with prime numbers. We have plenty of ways to implement it. Let’s first look at what a prime number means.

A ...