Home

Recursion

Introduction to Recursion: Recursion is a programming technique where a function calls itself to solve a problem by breaking it down into smaller, similar sub-problems. It’s a powerful approach used in various algorithms and data structures. Fundamentals of Recursive Functions A recursive function consists of two main components: Base Case...

Read more

Bit Manipulation

Introduction to Bit Manipulation: Bit manipulation is the process of applying certain logical operations on a given sequence of bits to achieve the desired results. It can reduce the need to loop over a data structure and speed up the coding process as bit manipulations are processed in parallel. The bits in the representation are indexed from ...

Read more

Modular Arithmetic

Introduction to Modular Arithmetic: Modular Arithmetic is an important topic in Competitive Programming. Some questions involve such big numbers that they can’t even fit in any of the data types. So, modular arithmetic is a method to avoid data overflow. Quotient Remainder Theorem It states that, for any pair of integers a and b (b is positive...

Read more

Combinatorics

Introduction to Combinatorics: What is combinatorics: Combinatorics is a branch of mathematics primarily concerned with counting and certain properties of finite structures. It deals with the study of enumeration, combination, and permutation of sets of elements and the mathematical relations that characterize their properties. In other word ...

Read more

Prefix and Suffix Sum

Introduction to Prefix and Suffix Sum: We are going to start with the Prefix Sum, also called cumulative sum or inclusive scan. And when we have covered that we will move on to the Suffix Sum, instead of having the sum direction from left to right, it will be from right to left. Prefix Sum Prefix sum, also known as cumulative sum, is a comput...

Read more

Exponentiation and Binary Exponentiation

Introduction to Exponentiation and Binary Exponentiation: Binary exponentiation, also known as exponentiation by squaring, is a technique used to efficiently compute large powers of a number modulo another number. It is particularly useful in computer science and cryptography where large numbers are involved. What is Binary Exponentiation? Bi...

Read more