Arnab Chakraborty has Published 4293 Articles

Fill 8 numbers in grid with given conditions in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 13:53:49

166 Views

Suppose we want to place 1, 2, 3, 4, 5, 6, 7, 8, into the eight circles in the given figure, in this way that no number is adjacent to a number that is next to it in the sequence.So, if the input is like0-1-10-1-1-1-10-1-10then the output will beTo solve ... Read More

Traversing a map (or unordered_map) in C++ STL

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 13:51:33

2K+ Views

Here we will see the map container and its use in C++. The maps are defined as associative containers that store elements in a hash-mapped fashion. Each element is associated with a key and value. No two mapped values can have identical keys. These are some fundamental methods that are ... Read More

Heap in C++ STL - make_heap(), push_heap(), pop_heap(), sort_heap(), is_heap, is_heap_until()

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 13:49:11

2K+ Views

In this section we will see the heap data structure present in C++ STL. This permits faster input into heap and retrieval of a number always results in the largest number i.e. largest number of the remaining numbers is popped out each time. Other elements of the heap are arranged ... Read More

Geometry using Complex Numbers in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 13:46:10

323 Views

In this section, we will see how to make point class using complex class from STL in C++. And apply them on some geometry related problems. The complex number is present inside the complex class from STL (#include )Defining Point ClassTo make complex to point, we will change the name ... Read More

Generating Test Cases (generate() and generate_n() in C++

Arnab Chakraborty

Arnab Chakraborty

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

310 Views

In this section we will see how we can use C++ STL function to generate test cases. Sometimes generating test cases for array programs can be very complicated and inefficient process. C++ provides two methods to generate test cases. These methods are as follows −The generate() methodThe C++ function std::algorithm::generate() ... Read More

Check if a number is Primorial Prime or not in Python

Arnab Chakraborty

Arnab Chakraborty

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

818 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

176 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

286 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

357 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

Advertisements