In this article, we will learn how to find the nth element of Stern’s Diatomic Series in C++. Stern’s Diatomic Series is a sequence 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5 …. whi.... Read More
In online coding contests, we often come across problems that are related to primality testing. So, why not we should learn about the algorithm, that can generate all possible prim.... Read More
A CAPTCHA is a test to check whether the user is a human or not. CAPTCHA verification is very widely used to determine the user is a human or machine. In this article, we will impl.... Read More
In this article, we will learn how to check whether a given matrix is scalar or not in C++. A square matrix is said to a scalar if all the diagonal elements of the matrix are equal.... Read More
In this article, we will learn how to implement a program to check whether the given two trees are identical or not in C++. Two trees are said to identical when they have the same .... Read More
Today we will see a rather interesting problem called the Chinese remainder problem and try to understand the theory behind it. The Chinese Remainder theorem was first introduced b.... Read More
The two knights problem is a general mathematical challenge, where we have to find the total number of ways to place two knights on an nxn chessboard such that they do not attack e.... Read More
Today, we will see how to find the lexicographic rank of a string in C++. The lexicographic rank of a string means the rank of the given string in a list of permutations of the giv.... Read More