# Enjoy Algorithmic Thinking

An initiative by enjoyalgorithms! We design content with in-depth explanations and help learners develop a dedicated interest in math, logic and algorithms.

Important Math Topics for Data Structures and Algorithms

Just like programming, math is one of the core parts of learning data structures and algorithms. We mainly use math to analyse efficiency of various algorithms. But sometimes, the problem itself contains mathematical property or requires some mathematical insight to find a solution.

Tower of Hanoi Puzzle

Problem description of the tower of Hanoi: Given a stack of n disks arranged from largest on the bottom to smallest on top placed on a rod A, together with two empty rods B and C. The objective is to move the n disks from rod A to rod C using rod B.

Find prime numbers in a range: Sieve of Eratosthenes

The sieve of Eratosthenes is an ancient and efficient algorithm for finding all primes numbers from 2 to n. This algorithm finds all the prime numbers in a segment using O(nlog⁡log⁡n) operations.

Check if a number is prime or not: Primality Test

Given a positive integer n, write a program to check if the number is prime or not. A number n > 1 is said to be a prime number if 1 and n are its only factors. In other words, a prime number is a number that is divisible only by two numbers itself and one.