Arnab Chakraborty has Published 4293 Articles

Area of the circumcircle of any triangles with sides given in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2019 07:28:26

147 Views

Here we will see how to get the area of the circumcircle of any triangle whose sides are given. Here the side AB is a, BC is b and CA is c, the radius is ‘r’.The radius r is same as −Example#include #include using namespace std; float area(float ... Read More

Addition and Subtraction of Matrix using pthreads in C/C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2019 07:19:09

919 Views

Here we will see how to perform the matrix addition and subtraction using multithreaded environment. The pthread is used to execute multiple threads simultaneously in C or C++.There are two matrices A and B. Order of each matrix is (m x n). Each thread will take each row, and perform ... Read More

C/C++ Program to Find sum of Series with n-th term as n power of 2 - (n-1) power of 2

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2019 07:15:14

170 Views

Here we will see how to get the sum of the series with n-th term as n2 – (n-1)2. The recurrence relation is like below −Tn = n2 − (n−1)2So the series is −We need to find S mod (109 + 7), where S is the sum of all terms ... Read More

Hidden tricks of C++ related to STL

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2019 07:07:31

255 Views

Here we will see some hidden tricks of C++ related to STL.Assign value of pairs using braces ‘{}’. We can use them to assign into tuples also.pair my_pair = make_pair(10, 20); pair my_pair2 = { 10, 20 }; //using braces pair my_pair3 = { 10, { 'A', 20 } }; ... Read More

Add all greater values to every node in the given BST

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2019 07:04:27

165 Views

Here we will see one interesting problem, where we will add greater values to every node in one given binary search tree. So the initial and final tree will be look like below −AlgorithmbstUpdate(root, sum) −Begin    if root is null, then stop    bstUpdate(right of room, sum)    sum ... Read More

Types of Polymorphisms - Ad-hoc, Inclusion, Parametric & Coercion

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2019 07:01:05

4K+ Views

Here we will see different types of polymorphism. The types are −Ad-HocInclusionParametricCoercionThe Ad-Hoc polymorphism is called as overloading. This allows function with same name to act in different manner for different types. The function and the operator both can be overloaded. Some language does not support operator overloading, but function ... Read More

A Puzzle using C Program

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2019 06:57:35

686 Views

Here we will see one C puzzle question. Suppose we have two numbers 48 and 96. We have to add the first number after the second one. So final result will be like 9648. But we cannot use any logical, arithmetic, string related operations, also cannot use any pre-defined functions. ... Read More

3-Way QuickSort (Dutch National Flag)

Arnab Chakraborty

Arnab Chakraborty

Updated on 20-Aug-2019 06:56:42

2K+ Views

Here we will see the quicksort technique but we will use three-way quicksort. The basic quicksort technique is just finding an element as pivot then partition the array around pivot, after that, recur for sub arrays on left and right of the pivot.The three-way quicksort is similar, but there are ... Read More

C++: Methods of code shortening in competitive programming?

Arnab Chakraborty

Arnab Chakraborty

Updated on 19-Aug-2019 14:35:42

424 Views

In this section we will see some examples of code shortening strategy for competitive programming. Suppose we have to write some large amount of codes. In that code, we can follow some strategy to make them more short.We can change the type-name to make it short. Please check the code ... Read More

A Space Optimized Solution of LCS in C Program?

Arnab Chakraborty

Arnab Chakraborty

Updated on 19-Aug-2019 14:28:42

227 Views

Here we will see one space optimized approach for LCS problem. The LCS is the longest common subsequence. If two strings are “BHHUBC” and “HYUYBZC”, then the length of the subsequence is 4. One dynamic programming approach is already their, but using the dynamic programming approach, it will take more ... Read More

Advertisements