Arnab Chakraborty has Published 4293 Articles

An application on Bertrandís ballot theorem in C/C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Jan-2020 07:51:43

213 Views

In Bertrand's original paper, he explains a proof depended on a general formula for the number of favourable sequences implementing a recursion relation.ExampleLet there are 5 voters, of whom 3 vote for candidate A and 2 vote for candidate B (so p = 3 and q = 2). Ten possibilities ... Read More

All combinations of strings that can be used to dial a number in C/C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Jan-2020 07:43:50

134 Views

With respect of a given number, display or print all possible combinations of strings that can be implemented to dial the given number in a phone with the help of following pecifications.In the given phone, we can dial, 2 implementing A or B or C, 3 implementing D or E ... Read More

Some Interesting Observations about C/C++ Ternary Operator

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Jan-2020 07:29:59

311 Views

We know that ternary operator is implemented instead of if..else clause. It is denoted by ?: . '?' symbol is equivalent to if part and ':' is equivalent to else part. The following 3 programs explain some interesting observation in case of ternary operator.The following program is able to compile ... Read More

C vs BASH Fork bomb in C/C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Jan-2020 07:25:12

443 Views

It is already cleared that the BASH fork bomb is much more powerful than its version of C program. The main cause is that in BASH the created process is detached from the parent. If the parent process (the one we initially started) is destroyed or killed, the remaining or ... Read More

Else and Switch Statements with initializers in C++17

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Jan-2020 07:22:23

278 Views

In many cases, we need to verify the value of something returned by a function and perform conditional operations based on this value. So our code is given below −// Some method or function return_type foo(Params) // Call function with Params and // store return in var1 auto var1 = ... Read More

AA Trees in C/C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Jan-2020 07:18:07

1K+ Views

An AA tree in computer science is defined as a form of balanced tree implemented for storing and retrieving ordered data efficiently. AA trees are treated as a variation of the red-black tree, a form of binary search tree which supports efficient addition and deletion of entries. As opposed to ... Read More

A-Buffer Method in C/C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Jan-2020 07:07:58

2K+ Views

A-Buffer technique in computer graphics is a simple hidden face detection mechanism used to medium scale virtual memory computers. This technique is also known as anti-aliased or area-averaged or accumulation buffer. This technique extends the algorithm of depth-buffer (or Z Buffer) technique. As the depth buffer technique can only be ... Read More

A Number Link Game in C/C++?

Arnab Chakraborty

Arnab Chakraborty

Updated on 29-Jan-2020 07:04:03

262 Views

The Game − Suppose an n × n array of squares. Out of these, some of the squares are empty, some are solid, and some non-solid squares are set by integers 1, 2, 3, … .Each integer maintains or occupies exactly two different squares on the board. The task of ... Read More

Postorder Tree Traversal in Data Structures

Arnab Chakraborty

Arnab Chakraborty

Updated on 21-Jan-2020 12:17:37

445 Views

In this section we will see the post-order traversal technique (recursive) for binary search tree.Suppose we have one tree like this −The traversal sequence will be like: 8, 5, 15, 23, 20, 16, 10AlgorithmpostorderTraverse(root): Begin    if root is not empty, then       postorderTraversal(left of root)     ... Read More

Huffman Trees in Data Structure

Arnab Chakraborty

Arnab Chakraborty

Updated on 16-Jan-2020 12:07:48

14K+ Views

DefinitionHuffman coding provides codes to characters such that the length of the code depends on the relative frequency or weight of the corresponding character. Huffman codes are of variable-length, and without any prefix (that means no code is a prefix of any other). Any prefix-free binary code can be displayed ... Read More

Advertisements