Pigeonhole Principle
Dirichlet's Box Principle

Search for a command to run...
Articles tagged with #algorithms
Dirichlet's Box Principle

Hello Readers, Introduction Here, I will be discussing an interesting data structure called "Fenwick Tree". Its structure was proposed by Boris Ryabko and was described by Peter Fenwick in an article from 1994. It is also called the "Binary Indexed T...

Technique It is a simple technique that can give you an end array after performing range queries of the form update(l, r, x). NOTE: update(l, r, x) means add x to all the elements in an array within the range l to r. arr[l] += x, arr[l + 1] += x, arr...

Hello, Sieve of Eratosthenes I hope you all know what Seive is. This article will give you different variations of sieves. So, for those who don't know what "Sieve of Eratosthenes" is, it is just a faster way to calculate all the prime numbers betwee...

Hui!! Euclid's Algo Let's start with GCD(Greatest Common Divisor). I would assume you know what GCD is. You might know different ways to calculate GCD. You might use Euclid's Algo to find the GCD of two numbers or you would just represent both number...

here I will be talking about two different things how to prove correctness of solution and how to approach to the solution.
