Arnab Chakraborty has Published 3734 Articles

Check if a number is Primorial Prime or not in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 13:41:55

872 Views

Suppose we have a number n, we have to check whether n is a primorial prime or not. A number is said to be a primorial prime when it is a prime number of the form pN# + 1 or pN# – 1 , where pN# indicates the primorial of ... Read More

Gaussian Filter Generation in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 13:41:20

2K+ Views

As we know the Gaussian Filtering is very much useful applied in the field of image processing. It is used to reduce the noise of an image. In this section we will see how to generate a 2D Gaussian Kernel. Gaussian Distribution for generating 2D kernel is as follows.$$G(x, y)= ... Read More

Computing index using pointers returned by STL functions in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 13:39:36

223 Views

In this section we will see how to generate index using pointers that are returned by STL in C++. As we know many inbuilt functions in C++ return the pointers to the position in memory which provides the address of desired number, but it has no relation with the actual ... Read More

Check if a number is an Achilles number or not in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 13:38:56

328 Views

Suppose we have a number n; we have to check whether n is an Achilles number or not. As we know a number is Achilles number when a number that is powerful (A number N is called Powerful Number when for every prime factor p of it, p^2 also divides ... Read More

How to make a C++ class whose objects can only be dynamically allocated?

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 13:37:16

399 Views

In this problem we will see how we can make one class for which we can only create objects through dynamic memory allocation, no direct object creation is permitted.The idea is simple. We have to create private destructor for that class. When the destructor is private, the compiler would produce ... Read More

Check if a number is a Trojan Numbers in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 13:35:01

189 Views

Suppose we have a number n, we have to check whether n is a Trojan Number or not. As we know that the Trojan Number is a number that is a strong number without a perfect power. A number n is a strong number when for every prime divisor or ... Read More

Where is an object stored if it is created inside a block in C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 13:30:13

1K+ Views

In this section we will discuss about where the variables and objects are stored in the memory when a C++ program is compiled. As we know, there are two parts of memory in which an object can be stored −Stack − All members that are declared inside block of memory, ... Read More

Check if a line at 45 degree can divide the plane into two equal weight parts in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 13:29:03

183 Views

Suppose we have n different points (Xi, Yi) in 2D coordinate and each point has a weight Wi, we have to check whether a line at 45 degree can be drawn. So that the sum of weights of points on each side will be same.So, if the input is like[[-1, ... Read More

Check if a king can move a valid move or not when N nights are there in a modified chessboard in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 13:26:52

443 Views

Suppose we have one infinite chessboard with the same rules as that of chess and if there are N knights coordinates on the infinite chessboard and the king’s coordinate, we have to check whether the King is checkmate or not. The coordinate of infinite board is bounded by large value ... Read More

What happens when more restrictive access is given to a derived class method in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 13:25:03

147 Views

In this section we will discuss about interesting facts restrictive access of derived class methods in C++. We will see some examples and analyze the output to know more about restrictions of using derived class methods in C++.Example (C++)Let us see the following implementation to get better understanding −#include ... Read More

Advertisements